View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Renaming the Worksheet through VBA

Another way is

Activesheet.Name = Range("F8").Text

but make sure there are no / in the date format, else it will error

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"abxy " wrote in message
...
Ok, i'm trying to rename my worksheet to the contents of cell F8,
which really isn't that big of a deal. However, Cell F8 is a date
formated as "mm/dd/yyyy" so when Excel tries to rename the worksheet,
if gives me an error saying that it can't rename the worksheet because
the name contains invalid characters. I'ved tried reformatting the cell
itself to include only valid characters, but Excel still interprets it
the with "/" in it. So i know now that I have to tell Excel to format
the date without the "/" in VBA, but how?


---
Message posted from http://www.ExcelForum.com/