Visual Basic - VBA

Life is soft - evento anual de software empresarial
 
Vista:
sin imagen de perfil

VBA

Publicado por Ana (26 intervenciones) el 02/06/2022 12:31:35
Buenos dias, a ver si me podéis echar una mano con esta macro. Estoy intentando ejecutar una macro para que envíe a una base de datos unos registros con formato de porcentaje pero no lo logro, he intentado hacer un format, subirlo directamente como número y nada...Adjunto la macro

El problema principalmente es que cuando enviamos a base de datos, los registros que son porcentaje no suben. He intentado hacer un format, he intentado subirlo directamente como número…

Muchas gracias!!!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Antoni Masana
Val: 1.259
Plata
Ha mantenido su posición en Visual Basic (en relación al último mes)
Gráfica de Visual Basic

VBA

Publicado por Antoni Masana (558 intervenciones) el 02/06/2022 15:21:03
He realizado algunos cambios en el código para verlo mejor, no resuelve tu problema pero me permite leer mejor el código.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
Option Explicit
Sub GrabaClientes()
    Dim cn As Object
    Dim Datos As Object
    Dim consultaSql As String
    Dim Conexion As String
    Dim AAPP As String
    Dim NUM_DOC As String
    Dim EMPRESA As String
    Dim PARENT_COMPANY As String
    Dim GP_LP As String
    Dim GESTOR_PERSONAL As String
    Dim IN_PLANT As String
    Dim SERVICE_MANAGER As String
    Dim KAM As String
    Dim TIPO_CONTRATO As String
    Dim RENOVACION As String
    Dim COTERMINO As String
    Dim FECHA_INICIO_CTO As Date
    Dim DURACION_CTO As Integer
    Dim FECHA_FIN_CTO As Date
    Dim NUM_LINEAS As Integer
    Dim PLAZO_AMORT_TERMINALES As Integer
    Dim BOLSAS_TERMINALES As String
    Dim POLITICA_RENOVE As String
    Dim PENALIZACION As String
    Dim ANEXO_VALOR_TERMINALES As String
    Dim TABLA_PENAL_TERMINALES As String
    Dim VALOR_ENTRE_T1 As Integer
    Dim VALOR_Y_T1 As Integer
    Dim IMPORTE_TRAMO_1 As Integer
    Dim VALOR_ENTRE_T2 As Integer
    Dim VALOR_Y_T2 As Integer
    Dim IMPORTE_TRAMO_2 As Integer
    Dim VALOR_ENTRE_T3 As Integer
    Dim VALOR_Y_T3 As Integer
    Dim IMPORTE_TRAMO_3 As Integer
    Dim VALOR_ENTRE_T4 As Integer
    Dim VALOR_Y_T4 As Integer
    Dim IMPORTE_TRAMO_4 As Integer
    Dim VALOR_ENTRE_T5 As Integer
    Dim VALOR_Y_T5 As Integer
    Dim IMPORTE_TRAMO_5 As Integer
    Dim VALOR_ENTRE_T6 As Integer
    Dim VALOR_Y_T6 As Integer
    Dim IMPORTE_TRAMO_6 As Integer
    Dim CARGO_ADICIONAL_TER_IPHONE_ALTA_GAMA As String
    Dim IMPORTE_CARGO_ADICIONAL_MODELO As Integer
    Dim CARGO_ADICIONAL_T_VOZ_DATOS_MAYOR_2GB As String
    Dim IMPORTE_CARGO_ADICIONAL_T_VOZ_DATOS As Integer
    Dim DEV_EQUIPOS_OFICINA_PLUS As String
    Dim IMPORTE_DEV_OFICINA_PLUS As Integer
    Dim DEV_EQUIPOS_INTERNET_MOVIL As String
    Dim IMPORTE_DEV_INTERNET_MOVIL As Integer
    Dim TABLA_PENAL_LINEA As String
    Dim PORC_12_M_D1 As Integer
    Dim PORC_12_M_D2 As Integer
    Dim PORC_12_M_D3 As Integer
    Dim PORC_12_M_D4 As Integer
    Dim PORC_24_18_M_D1 As Integer
    Dim PORC_24_18_M_D2 As Integer
    Dim PORC_24_18_M_D3 As Integer
    Dim PORC_24_18_M_D4 As Integer
    Dim PORC_36_M_D1 As Integer
    Dim PORC_36_M_D2 As Integer
    Dim PORC_36_M_D3 As Integer
    Dim PORC_36_M_D4 As Integer
    Dim PORC_PLUS_36_M_D1 As Integer
    Dim PORC_PLUS_36_M_D2 As Integer
    Dim PORC_PLUS_36_M_D3 As Integer
    Dim PORC_PLUS_36_M_D4 As Integer
    Dim DURANTE_PRORROGAS_PREAVISO As String
    Dim MESES_FACTURACION As Integer
    Dim T_VOZ As String
    Dim IMPORTE_T_VOZ As Integer
    Dim T_INTERNET_MOVIL As String
    Dim IMPORTE_T_INTERNET_MOVIL As Integer
    Dim PORC_BAJAS_LINEAS As String
    Dim PORC_BAJA As Integer
    Dim EXCEPCION_PEN As String
    Dim TIPO_EXCEPCION As String
    Dim PRIMARY_K As String
    Dim COMENT As String
 
    AAPP = Range("B2")
    NUM_DOC = Range("C2")
    EMPRESA = Range("D2")
    PARENT_COMPANY = Range("E2")
    GP_LP = Range("F2")
    GESTOR_PERSONAL = Range("G2")
    IN_PLANT = Range("H2")
    SERVICE_MANAGER = Range("I2")
    KAM = Range("J2")
    TIPO_CONTRATO = Range("K2")
    RENOVACION = Range("L2")
    COTERMINO = Range("M2")
    FECHA_INICIO_CTO = Range("N2")
    DURACION_CTO = Range("O2")
    FECHA_FIN_CTO = Range("P2")
    NUM_LINEAS = Range("Q2")
    PLAZO_AMORT_TERMINALES = Range("R2")
    BOLSAS_TERMINALES = Range("S2")
    POLITICA_RENOVE = Range("T2")
    PENALIZACION = Range("U2")
    ANEXO_VALOR_TERMINALES = Range("V2")
    TABLA_PENAL_TERMINALES = Range("W2")
    VALOR_ENTRE_T1 = Range("X2")
    VALOR_Y_T1 = Range("Y2")
    IMPORTE_TRAMO_1 = Range("Z2")
    VALOR_ENTRE_T2 = Range("AA2")
    VALOR_Y_T2 = Range("AB2")
    IMPORTE_TRAMO_2 = Range("AC2")
    VALOR_ENTRE_T3 = Range("AD2")
    VALOR_Y_T3 = Range("AE2")
    IMPORTE_TRAMO_3 = Range("AF2")
    VALOR_ENTRE_T4 = Range("AG2")
    VALOR_Y_T4 = Range("AH2")
    IMPORTE_TRAMO_4 = Range("AI2")
    VALOR_ENTRE_T5 = Range("AJ2")
    VALOR_Y_T5 = Range("AK2")
    IMPORTE_TRAMO_5 = Range("AL2")
    VALOR_ENTRE_T6 = Range("AM2")
    VALOR_Y_T6 = Range("AN2")
    IMPORTE_TRAMO_6 = Range("AO2")
    CARGO_ADICIONAL_TER_IPHONE_ALTA_GAMA = Range("AP2")
    IMPORTE_CARGO_ADICIONAL_MODELO = Range("AQ2")
    CARGO_ADICIONAL_T_VOZ_DATOS_MAYOR_2GB = Range("AR2")
    IMPORTE_CARGO_ADICIONAL_T_VOZ_DATOS = Range("AS2")
    DEV_EQUIPOS_OFICINA_PLUS = Range("AT2")
    IMPORTE_DEV_OFICINA_PLUS = Range("AU2")
    DEV_EQUIPOS_INTERNET_MOVIL = Range("AV2")
    IMPORTE_DEV_INTERNET_MOVIL = Range("AW2")
    TABLA_PENAL_LINEA = Range("AX2")
    PORC_12_M_D1 = Range("AY2")
    PORC_12_M_D2 = Range("AZ2")
    PORC_12_M_D3 = Range("BA2")
    PORC_12_M_D4 = Range("BB2")
    PORC_24_18_M_D1 = Range("BC2")
    PORC_24_18_M_D2 = Range("BD2")
    PORC_24_18_M_D3 = Range("BE2")
    PORC_24_18_M_D4 = Range("BF2")
    PORC_36_M_D1 = Range("BG2")
    PORC_36_M_D2 = Range("BH2")
    PORC_36_M_D3 = Range("BI2")
    PORC_36_M_D4 = Range("BJ2")
    PORC_PLUS_36_M_D1 = Range("BK2")
    PORC_PLUS_36_M_D2 = Range("BL2")
    PORC_PLUS_36_M_D3 = Range("BM2")
    PORC_PLUS_36_M_D4 = Range("BN2")
    DURANTE_PRORROGAS_PREAVISO = Range("BO2")
    MESES_FACTURACION = Range("BP2")
    T_VOZ = Range("BQ2")
    IMPORTE_T_VOZ = Range("BR2")
    T_INTERNET_MOVIL = Range("BS2")
    IMPORTE_T_INTERNET_MOVIL = Range("BT2")
    PORC_BAJAS_LINEAS = Range("BU2")
    PORC_BAJA = Range("BV2")
    EXCEPCION_PEN = Range("BW2")
    TIPO_EXCEPCION = Range("BX2")
    PRIMARY_K = Range("BY2")
    COMENT = Range("BZ2")
 
    Falta = False
    For a=2 to 77
      If Len(Cels(2, Col)) = 0 Then Falta=True: Exit For
    Next
 
    If Falta Then
       MsgBox "Datos Incompletos"
       Exit Sub
    End If
 
    Set cn = CreateObject("ADODB.connection")
    Conexion = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
               "Data Source=C:\Users\fderr\Documents\Proyecto Penalizaciones\Penalizacciones_GGCC.mdb"
 
    consultaSql = "insert into Clientes values(" & Chr(34) & AAPP & Chr(34) & "," & _
                                                   Chr(34) & NUM_DOC & Chr(34) & "," & _
                                                   Chr(34) & EMPRESA & Chr(34) & "," & _
                                                   Chr(34) & PARENT_COMPANY & Chr(34) & "," & _
                                                   Chr(34) & GP_LP & Chr(34) & "," & _
                                                   Chr(34) & GESTOR_PERSONAL & Chr(34) & "," & _
                                                   Chr(34) & IN_PLANT & Chr(34) & "," & _
                                                   Chr(34) & SERVICE_MANAGER & Chr(34) & "," & _
                                                   Chr(34) & KAM & Chr(34) & "," & _
                                                   Chr(34) & TIPO_CONTRATO & Chr(34) & "," & _
                                                   Chr(34) & RENOVACION & Chr(34) & "," & _
                                                   Chr(34) & COTERMINO & Chr(34) & "," & _
                                                       "#" & FECHA_INICIO_CTO & "#" & "," & _
                                                             DURACION_CTO & "," & _
                                                       "#" & FECHA_FIN_CTO & "#" & "," & _
                                                             NUM_LINEAS & "," & _
                                                              PLAZO_AMORT_TERMINALES & "," & _
                                                   Chr(34) & BOLSAS_TERMINALES & Chr(34) & "," & _
                                                   Chr(34) & POLITICA_RENOVE & Chr(34) & "," & _
                                                   Chr(34) & PENALIZACION & Chr(34) & "," & _
                                                   Chr(34) & ANEXO_VALOR_TERMINALES & Chr(34) & "," & _
                                                   Chr(34) & TABLA_PENAL_TERMINALES & Chr(34) & "," & _
                                                             VALOR_ENTRE_T1 & "," & _
                                                             VALOR_Y_T1 & "," & _
                                                             IMPORTE_TRAMO_1 & "," & _
                                                             VALOR_ENTRE_T2 & "," & _
                                                             VALOR_Y_T2 & "," & _
                                                             IMPORTE_TRAMO_2 & "," & _
                                                             VALOR_ENTRE_T3 & "," & _
                                                             VALOR_Y_T3 & "," & _
                                                             IMPORTE_TRAMO_3 & "," & _
                                                             VALOR_ENTRE_T4 & "," & _
                                                             VALOR_Y_T4 & "," & _
                                                             IMPORTE_TRAMO_4 & "," & _
                                                             VALOR_ENTRE_T5 & "," & _
                                                             VALOR_Y_T5 & "," & _
                                                             IMPORTE_TRAMO_5 & "," & _
                                                             VALOR_ENTRE_T6 & "," & _
                                                             VALOR_Y_T6 & "," & _
                                                             IMPORTE_TRAMO_6 & "," & _
                                                   Chr(34) & CARGO_ADICIONAL_TER_IPHONE_ALTA_GAMA & Chr(34) & "," & _
                                                             IMPORTE_CARGO_ADICIONAL_MODELO & "," & _
                                                   Chr(34) & CARGO_ADICIONAL_T_VOZ_DATOS_MAYOR_2GB & Chr(34) & "," & _
                                                             IMPORTE_CARGO_ADICIONAL_T_VOZ_DATOS & "," & _
                                                   Chr(34) & DEV_EQUIPOS_OFICINA_PLUS & Chr(34) & "," & _
                                                             IMPORTE_DEV_OFICINA_PLUS & "," & _
                                                   Chr(34) & DEV_EQUIPOS_INTERNET_MOVIL & Chr(34) & "," & _
                                                             IMPORTE_DEV_INTERNET_MOVIL & "," & _
                                                   Chr(34) & TABLA_PENAL_LINEA & Chr(34) & "," & _
                                                             PORC_12_M_D1 & "," & _
                                                             PORC_12_M_D2 & "," & _
                                                             PORC_12_M_D3 & "," & _
                                                             PORC_12_M_D4 & "," & _
                                                             PORC_24_18_M_D1 & "," & _
                                                             PORC_24_18_M_D2 & "," & _
                                                             PORC_24_18_M_D3 & "," & _
                                                             PORC_24_18_M_D4 & "," & _
                                                             PORC_36_M_D1 & "," & _
                                                             PORC_36_M_D2 & "," & _
                                                             PORC_36_M_D3 & "," & _
                                                             PORC_36_M_D4 & "," & _
                                                             PORC_PLUS_36_M_D1 & "," & _
                                                             PORC_PLUS_36_M_D2 & "," & _
                                                             PORC_PLUS_36_M_D3 & "," & _
                                                             PORC_PLUS_36_M_D4 & "," & _
                                                   Chr(34) & DURANTE_PRORROGAS_PREAVISO & Chr(34) & "," & _
                                                             MESES_FACTURACION & "," & _
                                                   Chr(34) & T_VOZ & Chr(34) & "," & _
                                                             IMPORTE_T_VOZ & "," & _
                                                   Chr(34) & T_INTERNET_MOVIL & Chr(34) & "," & _
                                                             IMPORTE_T_INTERNET_MOVIL & "," & _
                                                   Chr(34) & PORC_BAJAS_LINEAS & Chr(34) & "," & _
                                                             PORC_BAJA & "," & _
                                                   Chr(34) & EXCEPCION_PEN & Chr(34) & "," & _
                                                   Chr(34) & TIPO_EXCEPCION & Chr(34) & "," & _
                                                   Chr(34) & PRIMARY_K & Chr(34) & "," & _
                                                   Chr(34) & COMENT & Chr(34) & ")"
    cn.Open Conexion
    Set Datos = cn.Execute(consultaSql)
    MsgBox "Datos Guardados en BdD", vbInformation, "Nueva penalización"
End Sub
 
Sub ConsultaDatos()
    'Borramos datos de consultas previas
    Range("B2").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range("B2:BZ32").Select
    Selection.ClearContents
 
    Dim cn As Object
    Dim Datos As Object
    Dim ConsSQL As String
    Dim Conexion As String
    Dim DOC As String
    Dim Cont As Long
    Dim Campo1 As String
    Dim DatoCampo1 As String
    Dim ComplementoBusqueda1 As String
    Dim TipoBusqueda As String
 
    TipoBusqueda = Cells(35, 3)
    Campo1 = Cells(1, 3)
    DatoCampo1 = Cells(54, 3)
    If Len(TipoBusqueda) = 0 Or Len(Campo1) = 0 Or Len(DatoCampo1) = 0 Then
        Exit Sub
    End If
 
    If TipoBusqueda = "Exacta" Then
        ComplementoBusqueda1 = " = "
    Else
        ComplementoBusqueda1 = " like "
    End If
 
    Set cn = CreateObject("ADODB.connection")
    Conexion = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
               "Data Source=C:\Users\fderr\Documents\Proyecto Penalizaciones\Penalizacciones_GGCC.mdb"
    DOC = Range("C24")
    ConsSQL = "Select * From Clientes where " & Campo1 & ComplementoBusqueda1 & "'" & DatoCampo1 & "'"
    cn.Open Conexion
    Set Datos = cn.Execute(ConsSQL)
 
    Cont = 2
    Do While Not Datos.EOF
        For a=0 to 76
            Cells(Cont, a+1) = Datos.Fields(a)
        Next
        Cont = Cont + 1
        Datos.MoveNext
    Loop
    Datos.Close
    Set Datos = Nothing
    cn.Close
    Set cn = Nothing
End Sub

No se como tienes definido el campo de porcentaje en la Base de Datos pero en la macro esta definido como entero. Creo que el tipo de variable debería coincidir con el tipo de campo, es decir si el campo Porcentaje tiene decimales la variables deberían se Single y no Integer.

Después averigua si en la Base de Datos como guarda un porcentaje, esto se hace con un simple calculo:

Cantidad = 500
Porcentaje = 25%
Resultado de multiplicar Cantidad por Porcentaje es igual a 125 quiere decir que porcentaje se guarda como 0,25

Si en la hoja tienes en las columnas de porcentajes ( de la AY a la BN ) el valor como entero es decir 25 debes dividirlo por 100, en cambio si lo tienes como porcentaje, es decir 25% pasalo tal cual.

No trabajo con Access todo esto es teórico, no puedo probarlo y puedo estar seguro de que lo que cuento sea del todo correcto.

Saludos.
\\//_
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

VBA

Publicado por Ana (26 intervenciones) el 02/06/2022 15:38:28
Muchas gracias Antoni, pruebo lo que indicas a ver si hay suerte y te cuento
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

VBA

Publicado por Ana (26 intervenciones) el 02/06/2022 16:14:15
El problema es que al enviar a la base de datos está redondeando a cero o a uno dependiendo del valor, si lo importo sin la macro los valores viajan bien pero en la macro redondea, no se porqué ¿alguna idea?. Mil gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

VBA

Publicado por Ana (26 intervenciones) el 02/06/2022 18:13:02
Aclarar que no estoy tratando de enviar el formato % sino el numero en decimales, es decir si es el 25% lo que quiero que se envie es el 0,25 por eso he definido el campo como integer. El c aso es que a la hora de enviar a Access si el valor es mayor a 0,5 me pinta un 1 y si es menor me pinta un 0...
Gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de Antoni Masana
Val: 1.259
Plata
Ha mantenido su posición en Visual Basic (en relación al último mes)
Gráfica de Visual Basic

VBA

Publicado por Antoni Masana (558 intervenciones) el 02/06/2022 19:32:24
Es que si pones un valor con decimales redondea al entero en un campo integer, cambia en la definicion de las variables del porcentaje los integer por Single

Cambio a realizar

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Dim PORC_12_M_D1 As Integer Single
Dim PORC_12_M_D2 As Integer Single
Dim PORC_12_M_D3 As Integer Single
Dim PORC_12_M_D4 As Integer Single
Dim PORC_24_18_M_D1 As Integer Single
Dim PORC_24_18_M_D2 As Integer Single
Dim PORC_24_18_M_D3 As Integer Single
Dim PORC_24_18_M_D4 As Integer Single
Dim PORC_36_M_D1 As Integer Single
Dim PORC_36_M_D2 As Integer Single
Dim PORC_36_M_D3 As Integer Single
Dim PORC_36_M_D4 As Integer Single
Dim PORC_PLUS_36_M_D1 As Integer Single
Dim PORC_PLUS_36_M_D2 As Integer Single
Dim PORC_PLUS_36_M_D3 As Integer Single
Dim PORC_PLUS_36_M_D4 As Integer Single

Como debe quedar:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Dim PORC_12_M_D1 As Single
Dim PORC_12_M_D2 As Single
Dim PORC_12_M_D3 As Single
Dim PORC_12_M_D4 As Single
Dim PORC_24_18_M_D1 As Single
Dim PORC_24_18_M_D2 As Single
Dim PORC_24_18_M_D3 As Single
Dim PORC_24_18_M_D4 As Single
Dim PORC_36_M_D1 As Single
Dim PORC_36_M_D2 As Single
Dim PORC_36_M_D3 As Single
Dim PORC_36_M_D4 As Single
Dim PORC_PLUS_36_M_D1 As Single
Dim PORC_PLUS_36_M_D2 As Single
Dim PORC_PLUS_36_M_D3 As Single
Dim PORC_PLUS_36_M_D4 As Single

Saludos.
\\//_
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

VBA

Publicado por Ana (26 intervenciones) el 03/06/2022 09:00:40
Buenos días. Ahora al cambiarlo a Single me salta el error de el numero de valores de consulta y el numero de campos de destino son diferentes. Entiendo que esto se refiere a los campos que se envían a la base no coinciden con los de la tabla. Parece que la coma de los decimales la interpreta como un separador de campos y no se como puedo corregir eso ¿alguna idea?. Mil gracias!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de Antoni Masana
Val: 1.259
Plata
Ha mantenido su posición en Visual Basic (en relación al último mes)
Gráfica de Visual Basic

VBA

Publicado por Antoni Masana (558 intervenciones) el 03/06/2022 14:13:26
Siento no poder ayudarte más.

Mi mayor logro con Excel y Access a es salvar el escollo de la contraseña de la Base de Datos y leer desde Excel con una consulta SQL datos de una tabla de Access.
Hace tres o cuatro años sabía hacer una consulta de SQL en Access y como no lo uso ya ni me acuerdo de como funciona.

A ver si alguien con más experto en Access y Excel te puede ayudar.

Saludos.
\\//_
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar
sin imagen de perfil

VBA

Publicado por Ana (26 intervenciones) el 04/06/2022 08:45:54
Muchas gracias por todo Antoni. Creo que ya lo he solucionado con As Single en la macro como decias y formato numero doble en access y parece que así funciona. Buen fin de semana!!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar