Mi inquietud es la siguiente.
Tengo un problema con filtrar algunos datos que están en una base de datos ejemplo:
De esta forma no funcina
Sub Macro1()
Dim Celda As Long
Celda = Sheets("Sheet1").Cells(1,
Set qtQtrResults = _
Sheets("Sheet1").QueryTables(1)
With qtQtrResults
.CommandType = xlCmdSql
.CommandText = _
"Select * From Prueba where ID='Celda' order by TIPO"
.Refresh
End With
End Sub
De esta forma si funciona
Sub Macro1()
Set qtQtrResults = _
Sheets("Sheet1").QueryTables(1)
With qtQtrResults
.CommandType = xlCmdSql
.CommandText = _
"Select * From Prueba where ID='1972' order by TIPO"
.Refresh
End With
End Sub
Nota: He notado que cuando pongo el valor directo de la variabble Celda,osea, el valor 1972 me funciona perfectamente, pero, cuando utilizo la varoable Celda no me filtra o no funiona el Query.
No se si me he explicado bien, pero he intentado muchas maneras y no me funciona,aunque voy a tratar de seguir investiganfo sólo quiero que ustedes me den una manita.
Gracias y Saludos.
Ramón(Monchy).



