Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Naming work sheet the name as sub-routine that creates it
I have a macro that I'm trying to create several work sheets, and then put
information retrieved from a SQL database. I would like the name of each worksheet to be the same as the sub routine that created it. Is this possible through the code -- sub myworksheet worksheets.add worksheets.name(x) where x is the name of the sub end sub Thanks in advance. Rich Mogy |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Naming work sheet the name as sub-routine that creates it
This might not be terribly helpful, but you can give a worksheet any
name you want, provided it is <= 26 characters (which I believe is the limit for the sheet tab). --JP On Oct 3, 5:02*pm, "Rich Mogy" wrote: I have a macro that I'm trying to create several work sheets, and then put information retrieved from a SQL database. *I would like the name of each worksheet to be the same as the sub routine that created it. *Is this possible through the code -- sub myworksheet worksheets.add worksheets.name(x) where x is the name of the sub end sub Thanks in advance. Rich Mogy |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Naming work sheet the name as sub-routine that creates it
Understood -- but I want to use the naming convention I have described.
"JP" wrote in message ... This might not be terribly helpful, but you can give a worksheet any name you want, provided it is <= 26 characters (which I believe is the limit for the sheet tab). --JP On Oct 3, 5:02 pm, "Rich Mogy" wrote: I have a macro that I'm trying to create several work sheets, and then put information retrieved from a SQL database. I would like the name of each worksheet to be the same as the sub routine that created it. Is this possible through the code -- sub myworksheet worksheets.add worksheets.name(x) where x is the name of the sub end sub Thanks in advance. Rich Mogy |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Naming work sheet the name as sub-routine that creates it
I have never tried to determine the name of a sub being fired. You say
several. ?? Why not make a list with a for each item in the list create the sheet and name it for the item. ONE sub. sub dd() Sheets.Add ActiveSheet.Name = "dd" end sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Rich Mogy" wrote in message ... I have a macro that I'm trying to create several work sheets, and then put information retrieved from a SQL database. I would like the name of each worksheet to be the same as the sub routine that created it. Is this possible through the code -- sub myworksheet worksheets.add worksheets.name(x) where x is the name of the sub end sub Thanks in advance. Rich Mogy |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Naming work sheet the name as sub-routine that creates it
Don,
I've listed all the procedures in a module using info from here. http://www.cpearson.com/excel/vbe.aspx But I think your way is far easier to do. Barb Reinhardt "Don Guillett" wrote: I have never tried to determine the name of a sub being fired. You say several. ?? Why not make a list with a for each item in the list create the sheet and name it for the item. ONE sub. sub dd() Sheets.Add ActiveSheet.Name = "dd" end sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Rich Mogy" wrote in message ... I have a macro that I'm trying to create several work sheets, and then put information retrieved from a SQL database. I would like the name of each worksheet to be the same as the sub routine that created it. Is this possible through the code -- sub myworksheet worksheets.add worksheets.name(x) where x is the name of the sub end sub Thanks in advance. Rich Mogy |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Naming work sheet the name as sub-routine that creates it
Thanks to everyone who replied. I think this will handle it.
"Barb Reinhardt" wrote in message ... Don, I've listed all the procedures in a module using info from here. http://www.cpearson.com/excel/vbe.aspx But I think your way is far easier to do. Barb Reinhardt "Don Guillett" wrote: I have never tried to determine the name of a sub being fired. You say several. ?? Why not make a list with a for each item in the list create the sheet and name it for the item. ONE sub. sub dd() Sheets.Add ActiveSheet.Name = "dd" end sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Rich Mogy" wrote in message ... I have a macro that I'm trying to create several work sheets, and then put information retrieved from a SQL database. I would like the name of each worksheet to be the same as the sub routine that created it. Is this possible through the code -- sub myworksheet worksheets.add worksheets.name(x) where x is the name of the sub end sub Thanks in advance. Rich Mogy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
extracting totals from 1 work sheet to another work work sheet | Excel Discussion (Misc queries) | |||
Deleting a sheet creates a new one | Excel Discussion (Misc queries) | |||
Naming Sheet | Excel Discussion (Misc queries) | |||
Populating work sheet combox with another work sheet values | Excel Discussion (Misc queries) | |||
Clicking cells on sheet creates Text Box. How do I turn this off? | Excel Discussion (Misc queries) |