Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default Macro Copy Worksheet Name into worksheet A1

I have a 50 page workbook. I would like to create a macro to copy each
Worksheet name into each of their perspective A1 cells.

A1 in worksheet1 would display Worksheet1
A1 in worksheet2 would display Worksheet2

thank you
--
bmac
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default Macro Copy Worksheet Name into worksheet A1

hi
Sub namesheets()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Cells(1, 1).Value = ws.Name
Next ws
msgbox Done
End Sub

"bmac" wrote:

I have a 50 page workbook. I would like to create a macro to copy each
Worksheet name into each of their perspective A1 cells.

A1 in worksheet1 would display Worksheet1
A1 in worksheet2 would display Worksheet2

thank you
--
bmac

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,123
Default Macro Copy Worksheet Name into worksheet A1

Hi bmac

You can use a worksheet function if you want ?
http://www.xldynamic.com/source/xld.xlFAQ0002.html

If you want code post back

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"bmac" wrote in message ...
I have a 50 page workbook. I would like to create a macro to copy each
Worksheet name into each of their perspective A1 cells.

A1 in worksheet1 would display Worksheet1
A1 in worksheet2 would display Worksheet2

thank you
--
bmac

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default Macro Copy Worksheet Name into worksheet A1

thank you all for responding so quickly.
I found what I was looking for in this function:

=MID(CELL("filename",A1), FIND("]", CELL("filename", A1))+ 1, 255)

I will also investigate the links you have all suggesed to me as well.

this group is awsome.


--
bmac


"Ron de Bruin" wrote:

Hi bmac

You can use a worksheet function if you want ?
http://www.xldynamic.com/source/xld.xlFAQ0002.html

If you want code post back

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"bmac" wrote in message ...
I have a 50 page workbook. I would like to create a macro to copy each
Worksheet name into each of their perspective A1 cells.

A1 in worksheet1 would display Worksheet1
A1 in worksheet2 would display Worksheet2

thank you
--
bmac


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
VB Macro to Copy from Worksheet KCG Excel Discussion (Misc queries) 1 September 2nd 07 08:46 AM
Macro to copy worksheet clarknv Excel Discussion (Misc queries) 2 June 17th 07 08:42 PM
macro to copy worksheet vitorjose Excel Worksheet Functions 0 January 25th 07 01:01 AM
create a macro to copy a worksheet into another Sean Excel Discussion (Misc queries) 7 October 18th 06 10:19 PM
I need help with a macro which will copy a worksheet and.. Greegan Excel Worksheet Functions 2 July 29th 05 11:48 PM


All times are GMT +1. The time now is 08:28 AM.

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"