+ Reply to Thread
Results 1 to 17 of 17

Insert Column then insert designated number

Hybrid View

  1. #1
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Insert Column then insert designated number

    It should work as posted - with the annoyance of being prompted twice for the week number. The version will only ask once. Make sure you are pasting it into a standard module and not a sheet module in the VBE.

    Sub doStuff()
        Dim bRow As Long, strWeek As String, i As Integer
    strWeek = Application.InputBox("Week please")
    For i = 3 To 13 Step 10
    With Sheets(i)
        .Rows("1:6").EntireRow.Delete
        bRow = Cells(1, 1).End(xlDown).Row
       .Rows(bRow + 1 & ":" & Rows.Count).EntireRow.Delete
        .Columns(2).Insert
       .Range("B1") = "Week"
       .Range("b2:b" & bRow) = strWeek
    End With
    Next
    End Sub

  2. #2
    Registered User
    Join Date
    03-18-2010
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Insert Column then insert designated number

    I went back and tried it again and it still didn't work. I then went back and tried the first macro you created and it worked correctly. Could there be something in the top part of the code which identifies the Tabs to modify that could be the problem?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1