Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 897
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,355
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default 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
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
extracting totals from 1 work sheet to another work work sheet cj Excel Discussion (Misc queries) 2 October 27th 07 10:54 PM
Deleting a sheet creates a new one laralea Excel Discussion (Misc queries) 6 June 13th 07 12:22 AM
Naming Sheet mehare Excel Discussion (Misc queries) 4 August 14th 06 06:20 PM
Populating work sheet combox with another work sheet values sjayar Excel Discussion (Misc queries) 1 October 29th 05 03:22 PM
Clicking cells on sheet creates Text Box. How do I turn this off? Ken Excel Discussion (Misc queries) 3 April 27th 05 11:53 PM


All times are GMT +1. The time now is 11:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"