Computing.Net > Forums > Programming > Macro to populate worksheet tabs

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Macro to populate worksheet tabs

Reply to Message Icon

Name: 24HG_Hoop
Date: February 28, 2008 at 17:48:27 Pacific
OS: XP
CPU/Ram: 3800 / 2G
Product: clone
Comment:

Hi all,

Can somebody post the code necessary to copy a template tab into X new sheets, and renaming each sheet Test 1, Test 2, to Test X?

Thanks,
Hoop



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: March 2, 2008 at 17:47:50 Pacific
Reply:

Sub a()
Dim i As Integer
Dim s As Worksheet
Set s = Sheets("template")
For i = 1 To InputBox("Number of copies?", "NEED INPUT!", 5)
s.Copy after:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = "Test " & i
Next
End Sub


0
Reply to Message Icon

Related Posts

See More


WSH: Delete files in fold... Visual Studio Exp. vs Vis...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Macro to populate worksheet tabs

macro to notify by email when chang www.computing.net/answers/programming/macro-to-notify-by-email-when-chang/16787.html

How to Populate a Listbox from text file www.computing.net/answers/programming/how-to-populate-a-listbox-from-text-file-/20037.html

Using VB to rename Excel sheet tabs www.computing.net/answers/programming/using-vb-to-rename-excel-sheet-tabs/6024.html