Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename a sheet
I have a workbook that references different sheets with the command Sheets(1).Select Problem is this sheet somehow no longer exists in my workbook. When i get to this line in my code it errors out because the sheet doe not exist. Is there a way to rename one of my other sheets, say Sheet to be Sheets(1) Any help is great. Gree -- greenfalco ----------------------------------------------------------------------- greenfalcon's Profile: http://www.excelforum.com/member.php...fo&userid=1362 View this thread: http://www.excelforum.com/showthread.php?threadid=39185 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename a sheet
1 is an idex number indicating the first sheet in the tab order if all
sheets are visible. Possibly, you have made the first sheet hidden, so it can't be selected. -- Regards, Tom Ogilvy "greenfalcon" wrote in message ... I have a workbook that references different sheets with the command Sheets(1).Select Problem is this sheet somehow no longer exists in my workbook. When i get to this line in my code it errors out because the sheet does not exist. Is there a way to rename one of my other sheets, say Sheet2 to be Sheets(1) Any help is great. Green -- greenfalcon ------------------------------------------------------------------------ greenfalcon's Profile: http://www.excelforum.com/member.php...o&userid=13622 View this thread: http://www.excelforum.com/showthread...hreadid=391859 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename a sheet
hmm now that im looking at this, how is it even possible tha Sheets(1).Select returns an error? isnt it always there because it is reference to the sheets in a workbook -- greenfalco ----------------------------------------------------------------------- greenfalcon's Profile: http://www.excelforum.com/member.php...fo&userid=1362 View this thread: http://www.excelforum.com/showthread.php?threadid=39185 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename a sheet
I just found this from a vba developers site "Index Number A sheets Index number is determined by its position in the Workbook The left most sheet will always have an Index number of 1, the next o the right will be 2 and so on. Excel VBA allows us to specify any Shee by using it's Index number, but unfortunately this method is not used b Excel when we record a macro. It uses the Sheets Tab name like Sheets("Budget").Select If this sheet was the third from the left w could use: Sheets(3).Select. This is often a better option than usin the sheet tab name, but still has potential problems. By this I mean the sheets position in the Workbook could change if we add, remove o move sheets." how is it possible that Sheet(1) does not exist in my program -- greenfalco ----------------------------------------------------------------------- greenfalcon's Profile: http://www.excelforum.com/member.php...fo&userid=1362 View this thread: http://www.excelforum.com/showthread.php?threadid=39185 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename a sheet
It isn't possible that it doesn't exist. It is possible that you can't
select it. -- Regards, Tom Ogilvy "greenfalcon" wrote in message ... I just found this from a vba developers site "Index Number A sheets Index number is determined by its position in the Workbook. The left most sheet will always have an Index number of 1, the next on the right will be 2 and so on. Excel VBA allows us to specify any Sheet by using it's Index number, but unfortunately this method is not used by Excel when we record a macro. It uses the Sheets Tab name like; Sheets("Budget").Select If this sheet was the third from the left we could use: Sheets(3).Select. This is often a better option than using the sheet tab name, but still has potential problems. By this I mean, the sheets position in the Workbook could change if we add, remove or move sheets." how is it possible that Sheet(1) does not exist in my program? -- greenfalcon ------------------------------------------------------------------------ greenfalcon's Profile: http://www.excelforum.com/member.php...o&userid=13622 View this thread: http://www.excelforum.com/showthread...hreadid=391859 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rename a sheet
hehe, Shortly after i made my final post i checked a computer with th problem, you were correct in that the sheet in question was hidden. had forgotten about that. Thanks for your help Jaso -- greenfalco ----------------------------------------------------------------------- greenfalcon's Profile: http://www.excelforum.com/member.php...fo&userid=1362 View this thread: http://www.excelforum.com/showthread.php?threadid=39185 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i rename a sheet if the rename tab is inactive? | Excel Worksheet Functions | |||
macro to: Add new sheet, then rename new sheet with todays date | Excel Worksheet Functions | |||
Move data to new sheet - rename sheet based on criteria ? | Excel Discussion (Misc queries) | |||
Rename Sheet | Excel Discussion (Misc queries) | |||
Button to copy sheet, rename sheet sequencially. | Excel Programming |