help with code

B

bobh

Hi All,

I have this code below and it error on the line --> wks.Select with
the error message error 1004.
Any ideas of what I'm doing wrong and how to fix it.
Thanks
bobh.

Set sh = Worksheets(Array("TBL BUDGET", "TBL S2B", "TBL PAYCODE",
"table1 rev"))
For Each wks In sh
wks.Select
Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False
Next wks
 
D

Don Guillett

Hi All,

I have this code below and it error on the line --> wks.Select with
the error message error 1004.
Any ideas of what I'm doing wrong and how to fix it.
Thanks
bobh.

Set sh = Worksheets(Array("TBL BUDGET", "TBL S2B", "TBL PAYCODE",
"table1 rev"))
For Each wks In sh
wks.Select
Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False
Next wks

You don't have to select however you probably have a typo on a sheet name.
Try it with wks.select and a msgbox "HI"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top