Johnis2Deezy
New Member
- Joined
- Feb 17, 2014
- Messages
- 7
I am trying to set a variable to a querytable as this macro will be run on multiple spreadsheets that are created for each new day. So the macro needs to refer to the activesheets listobject(1). I used the example on the msdn website, but i still get this error. Here is the code, can someone help me get around this? Thanks!!
Code:
Sub querytable
Dim ws As Worksheet
Dim Table As Variant
Set ws = ActiveSheet
Set Table = ws.ListObjects(1).QueryTable
End Sub