LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Referencing Different Sheets in VBA

You can also refer to a sheet by its codename, which is not likely to be
changed by users (as there is really no reason for users to change it). It
is separate from the tab name.

In the VBA editor (specifically the project viewer under Microsoft Excel
Objects) the code name appears first, followed by the tab name in
parentheses.

Sheet1 (TabName)

You can reference by Sheet1.Cells(1, 1).Value regardless of what the tab
name is.



" wrote:

Hi,

How can I make refer to a cell in a certain worksheet (say the 3rd one
listed), without referring to it by name, as it will vary? I'd like to
be able to do this in formulas in Visual Basic, so basically say:

Cells(1,1).Value = Sheets("[name]").Cells(1,1).Value

Thanks!
Brett




 
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
Referencing other sheets - updates shakey1181 Excel Discussion (Misc queries) 7 July 24th 06 01:59 AM
Excel referencing across sheets Richard Hocking Excel Discussion (Misc queries) 1 February 1st 06 04:47 PM
Copying formulas referencing multiple sheets JA Excel Worksheet Functions 1 January 11th 06 12:22 AM
Formulas referencing other sheets eel77 Excel Discussion (Misc queries) 4 July 18th 05 07:34 AM
Referencing Sheets in a Formula Christopher Anderson Excel Discussion (Misc queries) 1 January 31st 05 04:10 PM


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