View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff[_2_] Harald Staff[_2_] is offline
external usenet poster
 
Posts: 449
Default Help with text function

Hi ALbert

Try
Sheets("SET UP").Name = "SET UP " & Range("B3".Text)
or
Sheets("SET UP").Name = "SET UP " & Format$(Range("B3").Value, "dd - mm -
yyyy")

HTH. Best wishes Harald

"Albert Browne" wrote in message
...
I am trying to copy a sheet to a different workbook and then rename the
sheet by adding a date from cell B3. I have seen the text() function below
used to get the date from a cell and convert it to text. When I try what
is shown below I get variable not defined. Only part of the macro is
shown. Cell B3 is formatted as Date. What am I doing wrong?



Sheets("SET UP").Select
Sheets("SET UP").Copy Befo=Workbooks("Archives.xls").Sheets(1)
Sheets("SET UP").Select
Sheets("SET UP").Name = "SET UP " & Text(B3, "dd - mm - yyyy")

Thanks,

Albert