LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default error with macro to name new worksheet with cell from old worksheet

Hi all,
I seem to be having with my simple code below. I'm creating a new
worksheet with range from old worksheet and want to rename the new
worksheet with a cell value from old worksheet but am getting an error.
can anyone help?

For Each sh In ThisWorkbook.Worksheets
'Bold section headings
sh.Range("A2,A4").Font.Bold = True


'Make second worksheet

Set Newsh = ThisWorkbook.Worksheets.Add


sh.Range("A23:G95").Cut _
Destination:=Newsh.Range("a1")


sh.Range("A:g").Copy

Newsh.Range("a:g").PasteSpecial Paste:=xlPasteFormats
Newsh.Name = sh.Range("A2").Value (ERROR HERE)

 
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
Macro to name worksheet tabs using a cell within the worksheet? Jennifer Excel Discussion (Misc queries) 4 November 6th 12 05:03 PM
Macro error when worksheet is protected Soroya1920 Excel Discussion (Misc queries) 2 August 27th 07 06:42 PM
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error [email protected] Excel Discussion (Misc queries) 4 September 25th 06 01:35 PM
run time error 1004 on protected worksheet when I try to run macro dtg_denver Excel Programming 13 August 13th 05 01:23 AM
Help Please! Macro Error on Select Worksheet Apressler Excel Programming 1 September 23rd 04 04:58 PM


All times are GMT +1. The time now is 07:21 AM.

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

About Us

"It's about Microsoft Excel"