+ Reply to Thread
Results 1 to 7 of 7

VBA loop help

  1. #1
    Registered User
    Join Date
    10-13-2012
    Location
    newcastle
    MS-Off Ver
    Excel 2007
    Posts
    68

    VBA loop help

    Hello,

    I am looking to produce a list as follows

    Week 1
    Week 1
    Week 1
    Week 1
    Week 1
    Week 1
    Week 1
    Week 2
    Week 2
    Week 2
    Week 2
    Week 2
    Week 2
    Week 2
    etc

    Basically the week number is listed 7 times before incrementing by 1.The whole process would begin on row 2
    This continues on until the column previous does does not have any data in it ( a blank cell)
    How would i do this? Looking to do this byVBA

    Help much appreciated.

    Kind Regards,

  2. #2
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: VBA loop help

    Please Login or Register  to view this content.
    ...where A2 represents the topmost cell in the column to left.

  3. #3
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: VBA loop help

    If you just want the text rather than formula...
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: VBA loop help

    Try...

    With sample file >> Alt + F8 >> Macro Dialog Box >> Highlight macro (loopit) >> Run

    Macro looks at column A to establish the last row
    Attached Files Attached Files
    HTH
    Regards, Jeff

  5. #5
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: VBA loop help

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-13-2012
    Location
    newcastle
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: VBA loop help

    This is ace Thank you. Worked a treat.

    Quote Originally Posted by jhren View Post
    Please Login or Register  to view this content.
    ...where A2 represents the topmost cell in the column to left.

  7. #7
    Registered User
    Join Date
    10-13-2012
    Location
    newcastle
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: VBA loop help

    Thank you, just tested this works a treat to. Many Thanks for your response.

    Quote Originally Posted by squirrely View Post
    This is ace Thank you. Worked a treat.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  2. Why did an inner loop variable start overwriting the outer loop range suddenly?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2012, 03:24 PM
  3. Macro Loop Broken. Detects Max but doesn't continue loop
    By herchenbach in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2011, 12:17 PM
  4. Replies: 0
    Last Post: 07-20-2010, 11:42 AM
  5. Loop a column on Sheet1 and loop a row on Sheet2 to find a match
    By johnnywinter in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-13-2009, 02:09 PM

Tags for this Thread

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