+ Reply to Thread
Results 1 to 5 of 5

How to repeat the macro for a range of rows

  1. #1
    Registered User
    Join Date
    05-17-2020
    Location
    Uk
    MS-Off Ver
    Office 365
    Posts
    20

    How to repeat the macro for a range of rows

    Hi people,

    First time on here and i'm hoping to get some help on a macro i've been working on. I don't come from a coding background and so i've been searching as best i can for a solution but to no avail so far.

    I have a macro which works as i want:

    Sub Simple_if()
    If Range("AB9").Value > 0 And Range("AK9").Value = "" Then
    Range("AK9").Value = Range("AB9").Value
    Range("AI9").Value = "Open"

    End If

    End Sub



    I want this macro to repeat from row 9 to row 36. Is there a simple way to do this as opposed to having 28 seperate macros?

    Hope this makes sense.

    Thanks.
    Last edited by adboy14; 05-18-2020 at 12:28 PM.

  2. #2
    Registered User
    Join Date
    03-22-2019
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    34

    Re: How to repeat the macro for a range of rows

    Try this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-17-2020
    Location
    Uk
    MS-Off Ver
    Office 365
    Posts
    20

    Re: How to repeat the macro for a range of rows

    Great thanks for this it gets me so close!

    I have now found that I need another condition being that if cell AB is blank then it moves on otherwise do the above formula.


    Again, any help will be greatly appreciated.

    Thanks

  4. #4
    Registered User
    Join Date
    03-22-2019
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    34

    Re: How to repeat the macro for a range of rows

    Quote Originally Posted by adboy14 View Post
    I have now found that I need another condition being that if cell AB is blank then it moves on otherwise do the above formula.
    If I understood you correctly, this should do it:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-17-2020
    Location
    Uk
    MS-Off Ver
    Office 365
    Posts
    20

    Re: How to repeat the macro for a range of rows

    Perfect exactly what I was looking for!!! Thanks for the help!

+ 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] Repeat macro in next rows
    By niels1982 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2018, 04:16 AM
  2. I'd like my macro to repeat in all rows in the worksheet...
    By wintermedia in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-16-2013, 04:41 PM
  3. macro recorded for the first row, how to repeat it on the next 300 rows
    By sdic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2012, 05:15 AM
  4. [SOLVED] How to repeat conditional SUM/COUNTA of columns across a range of rows
    By carleaston in forum Excel General
    Replies: 8
    Last Post: 05-24-2012, 12:25 PM
  5. repeat macro for all rows
    By Rick Billingsley in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-25-2011, 01:05 PM
  6. Trying to get this Macro to repeat on all rows, not just the first one
    By Dfire in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-10-2007, 06:25 AM
  7. h/t quickly repeat macro on more rows
    By amberinferno in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-26-2005, 06:29 PM

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