+ Reply to Thread
Results 1 to 3 of 3

A simple loop

  1. #1
    Registered User
    Join Date
    06-28-2011
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010, Excel 2011 for mac
    Posts
    82

    A simple loop

    Hi,

    I have written a little code that performs some formatting on the activecell.

    Now, I would like for Excel to do this for every tenth cell in column C, starting at row 5.

    So I would like my code to run in cell C5, then cell C15, then cel C25 etc. until cell C1585

    How do I go about this in VBA?

    regards,
    kbka

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: A simple loop

    you need to insert step statement.

    So if you want to loop row 5 to 100 and skip every other 4 rows, it will looks like For i = 5 to 100 step 4 Next i

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: A simple loop

    Please Login or Register  to view this content.

+ 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