Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming worksheets
Hi All Is there a way of giving the worksheet name the same as the value of a cell? Thanks Oz -- ozcank ------------------------------------------------------------------------ ozcank's Profile: http://www.excelforum.com/member.php...fo&userid=5328 View this thread: http://www.excelforum.com/showthread...hreadid=382406 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming worksheets
Hi,
Yeah just pass the name of the cell to a variable and then use that to name the sheet, something like: Dim ShtName as string ShtName = Range("A5").value Activesheet.name = ShtName If you then wanted to name quite a few you could then just set a loop hence the reason I used activesheet rather than sheets("name") James |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming worksheets
hi ozcank...
try this: imagine sheets(1) as the first sheet of the workbook: Sheets(1).Name = Cells(1, 1) sheet(1) have the value of first row,column Miguel "ozcank" wrote: Hi All Is there a way of giving the worksheet name the same as the value of a cell? Thanks Oz -- ozcank ------------------------------------------------------------------------ ozcank's Profile: http://www.excelforum.com/member.php...fo&userid=5328 View this thread: http://www.excelforum.com/showthread...hreadid=382406 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming worksheets
Worksheets("Sheet1").name=Range("A1").Value You can omit the ".Value" "ozcank" wrote: Hi All Is there a way of giving the worksheet name the same as the value of a cell? Thanks Oz -- ozcank ------------------------------------------------------------------------ ozcank's Profile: http://www.excelforum.com/member.php...fo&userid=5328 View this thread: http://www.excelforum.com/showthread...hreadid=382406 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming worksheets
Thanks guys, it works perfectly now. Cheers Oz -- ozcank ------------------------------------------------------------------------ ozcank's Profile: http://www.excelforum.com/member.php...fo&userid=5328 View this thread: http://www.excelforum.com/showthread...hreadid=382406 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming worksheets
You can do by sheetname: Sheets("Sheet1").Name = Range("A1").value or by sheetindex Sheets(1).Name = Range("A1").value -- Kaak ------------------------------------------------------------------------ Kaak's Profile: http://www.excelforum.com/member.php...fo&userid=7513 View this thread: http://www.excelforum.com/showthread...hreadid=382406 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Naming new worksheets | Excel Discussion (Misc queries) | |||
Naming worksheets... | Excel Discussion (Misc queries) | |||
naming worksheets | Excel Worksheet Functions | |||
Worksheets Add & Naming | Excel Programming | |||
Naming Worksheets in VBE | Excel Programming |