Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default help with code

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default help with code

On Thursday, June 7, 2012 3:20:42 PM UTC-5, bobh wrote:
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"




On Thursday, June 7, 2012 3:20:42 PM UTC-5, bobh wrote:
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating excel file, adding code to it from code, VBE window stays BlueWolverine Excel Programming 0 November 5th 09 07:55 PM
How can I modify my code to offset the defined range and repeat theprocedure instead of duplicating my code? [email protected] Excel Programming 4 May 29th 09 10:13 PM
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does ker_01 Excel Programming 6 October 3rd 08 09:45 PM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
Excel code convert to Access code - Concat & eliminate duplicates italia Excel Programming 1 September 12th 06 12:14 AM


All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"