Mass rename of worksheets/Workbooks

P

Patrick Molloy

here's a framework you can use...copy to a standard
module & change where appropriate

Sub AllThingsArePossible()

Dim wb As Workbook
Dim fn As String

ChDrive "H"
ChDir "H:\excel_demos"

' initialise
fn = Dir("*.xls")

Do While fn <> ""

Set wb = Workbooks.Open(fn)

wb.Worksheets(1).Name = "newname"

wb.Save
wb.Close False

fn = Dir()

Loop



End Sub
 

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

Top