Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

vba courses london - vba

Forum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - VBA

vba courses london - VBA

ResolvedVersion Standard

Nick has attended:
Excel VBA Intro Intermediate course
Excel VBA Intro Intermediate course
Excel VBA Intro Intermediate course
Excel VBA Advanced course

VBA

How can i use VBA to run an edit and replace function multiple times with different values for find and replace each time to create multiple documents by save as.

RE: VBA

All you need to do is create a loop that after editing the document saves it under a different name eg

Sub EditRoutine

Dim Sheet As Worksheet
Dim SheetName As String

For Each Sheet In ActiveWorkbook.Worksheets

SheetName = Sheet.Name

<Run Edit/Replace Function>

Sheet.Save As "C:\My Documents\New" & SheetName

Next Sheet

End Sub

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

VBA tip:

Add A New Sheet at the end of the Workbook

To add a new sheet at the end of the workbook you need to count the sheets in the workbook using:

Sheets.Count

Then use this value as the rank of the sheet after which you want to add the new sheet:

Sheets.Add After:=Sheets(Sheets.Count)

View all VBA hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.