View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Rename Parent worksheet.name?

You need to set the Parent of a range:

Sub ordinate()
MsgBox (Selection.Address)
MsgBox (Selection.Parent.Name)
Selection.Parent.Name = "rick"
End Sub
--
Gary''s Student - gsnu200756


"Rick S." wrote:

I know how to rename a worksheet in VBA, ***Sheets(i).Name = "Sheet" & i"***,
but I can not seem to rename the parent name.
Using ***Sheets(i).Parent.Name*** errors out. (invalid assignment?)
If I create a worksheet it counts and adds to the parent name so I could end
up with Sheet15(Sheet2) what I want is Sheet2(Sheet2).

Thank you in advance.
--
Regards

Rick
XP Pro
Office 2007