Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this:
Cells(1,1).Value = Sheets(3).Cells(1,1).Value wrote in message ups.com... 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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
That's great!
Is there also a way to count the number of sheets I have? Thanks! PCLIVE wrote: Try this: Cells(1,1).Value = Sheets(3).Cells(1,1).Value wrote in message ups.com... 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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Use a variable to record the number of sheets. That way you can reference as needed. sh = sheets.count HTH, Paul wrote in message oups.com... That's great! Is there also a way to count the number of sheets I have? Thanks! PCLIVE wrote: Try this: Cells(1,1).Value = Sheets(3).Cells(1,1).Value wrote in message ups.com... 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 |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Referencing other sheets - updates | Excel Discussion (Misc queries) | |||
Excel referencing across sheets | Excel Discussion (Misc queries) | |||
Copying formulas referencing multiple sheets | Excel Worksheet Functions | |||
Formulas referencing other sheets | Excel Discussion (Misc queries) | |||
Referencing Sheets in a Formula | Excel Discussion (Misc queries) |