help with code

  • Thread starter Thread starter bobh
  • Start date Start date
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
 
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"
 
Back
Top