rename sheet

  • Thread starter Thread starter Steph
  • Start date Start date
S

Steph

Hi. If I copy a sheet to a new workbook, how can I rename that sheet with a
left function?

For example, the sheet I copied from book1 was called
"sheet1of_the_workbook". In excel terms, I want to rename the sheet
Left(that sheet name,5).

Thanks!
 
Dim sStr as String
sStr = "sheet1of_the_workbook"
worksheets(sStr).Name = Left(sStr,5)
 
Back
Top