Excel VBA/Macro programming help?!?

Excel Macro (VBA) programming help?

Basically, I'm looking for a macro code that would help me create a new sheet AND call it ''week1''. Then, next time you click on the macro it would create another new sheet and call it ''week2'', then ''week3'' and so on.. (I also want the new sheets to have some data in them already, as soon as they are opened, so could you leave some room in the vba for that? if not then it doesn't matter)

So yeah, any help would be appreciated. Thanks.

Update:

I thought i'd ask it in another category just in case, jeez :|

2 Answers

Relevance
  • 8 years ago
    Favorite Answer

    Here is one basic macro to do as you wish.

    Sub AddNewSheets()

    Dim ctr

    For Each ws In Sheets

    If UCase(Left(ws.Name, 4)) = "WEEK" Then

    If Right(ws.Name, 1) > ctr Then

    ctr = Right(ws.Name, 1)

    End If

    End If

    Next

    Sheets.Add

    ActiveSheet.Name = "Week" & ctr + 1

    End Sub

    If you can provide the additional information you wish to add to each new sheet, perhaps we can amend the code to handle that, also.

    • Login to reply the answers
  • pete l
    Lv 6
    8 years ago

    You asked this Q once,already

    • Login to reply the answers
Still have questions? Get your answers by asking now.