LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Select worksheet using a variable

I am trying to copy data from one worksheet into another based on the value
in one of the cells in the original worksheet.
I have declared the variable and set the Sheets.select as follows

Dim sheetName
Sheets(sheetName).Select

when the code gets to the Sheets(sheetName).Select line it gives a Runtime
error and says Subscript out of range. Any ideas why this is happenig and how
to correct it.
Thanks
Neal
 
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
Using a variable to select a cell on a worksheet..."Subscript out orrange" Zarlot Excel Programming 4 May 28th 08 07:27 PM
select cell by variable name Adam Excel Discussion (Misc queries) 6 May 20th 08 07:54 PM
worksheet select using variable Kryer Excel Programming 3 November 11th 05 12:17 AM
In Excel 2000, How do you select the whole of a worksheet (Select. Rascal Excel Discussion (Misc queries) 1 March 5th 05 12:03 AM
In Excel 2000, How do you select the whole of a worksheet (Select. Rascal Excel Discussion (Misc queries) 1 March 4th 05 11:59 PM


All times are GMT +1. The time now is 08:30 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"