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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top