View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Macro to Create New Worksheet and Reference Cell in Old Worksheet

Try changing

Active.Sheet.Name = A
to
ActiveSheet.Name = A

Vaya con Dios,
Chuck, CABGx3


" wrote:

Here is the code:

Dim A As String
A = Range("J3").Value
ActiveSheet.Select
ActiveSheet.Copy , Befo=Sheets(1)
ActiveSheet.Select
Active.Sheet.Name = A
Range("F5").Select

The value in J3 is 10-02 (formatted as text using =TEXT(F4, "MM-DD").
It runs fine until the line "Active.Sheet.Name = A" and then stops with
a 424 error "Object Required". Up to this point the new spreadsheet
has been created but the tab name is still a copy of the old one.
It is supposed to use the text in cell J3...

Lastly I would like the cell F5 in the new worksheet to be the current
date.