Sub CustomQuery()
Dim cat As ADOX.Catalog
Dim cmd As ADODB.Command
Dim strPath As String
Dim newStrSQL As String
Dim oldStrSQL As String
Dim strQryName As String
Dim myArr()
Dim objCell As Object
Dim lstRow As Long
lstRow = Cells(Rows.Count, "A").End(xlUp).Row
ReDim myArr(0 To lstRow - 2)
'lastrow
Sub CustomQuery()
Dim cat As ADOX.Catalog
Dim cmd As ADODB.Command
Dim strPath As String
Dim newStrSQL As String
Dim oldStrSQL As String
Dim strQryName As String
Dim myArr()
Dim objCell As Object
Dim lstRow As Long
lstRow = Cells(Rows.Count, "A").End(xlUp).Row
ReDim myArr(0 To lstRow - 2)
'lastrow