+ Reply to Thread
Results 1 to 5 of 5

Macro to highlight every other row (regardless of range location)

  1. #1
    Registered User
    Join Date
    11-14-2013
    Location
    Idaho
    MS-Off Ver
    Excel 2003
    Posts
    7

    Macro to highlight every other row (regardless of range location)

    I'm currently using:

    Please Login or Register  to view this content.
    ...but I find it only works if the first row is within the same number of rows specified in RowsBetween.

    For example, if RowsBetween = 2, and I select a range where the top row is greater than or equal to 3, it will not work properly, but instead select only one row; the row directly under the first row is selected in the desired range; the column count highlighted would be correct; just not the desired range of rows. Any ideas?
    Last edited by alansidman; 02-24-2016 at 12:59 PM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,938

    Re: Macro to highlight every other row (regardless of range location)

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    11-14-2013
    Location
    Idaho
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Macro to highlight every other row (regardless of range location)

    Thanks Alan; will do.

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Macro to highlight every other row (regardless of range location)

    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  5. #5
    Registered User
    Join Date
    11-14-2013
    Location
    Idaho
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Macro to highlight every other row (regardless of range location)

    Thanks walruseggman; that will definitely be useful, though I noticed that the rows are highlighted all the way out, rather than only to the end of the selected range. How could I limit the highlighting only to the selected range? Thanks for any help you (or anyone) can offer!

+ 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] macro to compare a range with a standard range and highlight cells, when not matched
    By excelhelpseeker in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-27-2014, 12:46 PM
  2. [SOLVED] VBA Macro to copy a range of cells and paste to a new location
    By JuneTwentyFourteen in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-20-2014, 10:38 AM
  3. macro to copy range hidden paste in a specific location
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2014, 11:27 AM
  4. [SOLVED] How to highlight a range in a macro without replacing it with a range name such as C1:L15
    By Mary Mullen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2014, 04:14 PM
  5. Replies: 1
    Last Post: 08-18-2013, 05:00 PM
  6. [SOLVED] macro to 'save as pdf' that prompts for filename, location AND only prints specified range
    By mtcolombo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2013, 01:49 PM
  7. [SOLVED] Highlight range of cells - run macro - select last cell in range
    By chromachem in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2012, 11:46 AM

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