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: 2
Default using variables in codenames

I am trying to write a code that allow a variable in the code name of a
worksheet.

Example
3 worksheets in the workbook with the following names:
worksheet 1 codename = page1
worksheet 2 codename = page2
worksheet 3 codename = page3

I want to write a code that works like the following:

for x = 1 to 3
worksheets(page x .Name).activate ' or other sheet
comand using codename
range ("a1")= "1"
next x

instead of writing the following
worksheets(page1 .Name).activate
range ("a1")= "1"
worksheets(page2 .Name).activate
range ("a1")= "1"
worksheets(page3 .Name).activate
range ("a1")= "1"

suggestions?

 
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
Loops with sheet codenames NEMB Excel Discussion (Misc queries) 0 February 13th 11 12:34 AM
Excel Worksheet Codenames Alasdair Stirling Excel Programming 6 November 2nd 04 07:33 AM
Excel Worksheet Codenames 2 Alasdair Stirling[_2_] Excel Programming 4 November 1st 04 03:46 PM
Using worksheet codenames dan Excel Programming 0 January 22nd 04 09:46 PM
strange worksheet.codenames in XL97 Arne[_2_] Excel Programming 0 July 28th 03 03:35 PM


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