+ Reply to Thread
Results 1 to 4 of 4

need help on data highlighting

  1. #1
    Registered User
    Join Date
    04-24-2014
    Location
    Taipei, Taiwan
    MS-Off Ver
    Excel 2010
    Posts
    7

    need help on data highlighting

    Dear All,
    I am a newbie in writing VBA and has absolutely no clue to how to write one (apart from relying on tutorials). I have written the following and got stuck
    Please Login or Register  to view this content.
    My spreadsheet consist of 3 rows of numbers for every sample, and I want to highlight with grey every three rows at a time to tell one apart from another. With the current strings I can only highlight one row, anyone knows how to expand the selection?
    Last edited by wilson181085; 04-24-2014 at 11:48 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: need help on data highlighting

    Hi Wilson181085, and welcome

    without even trying to execute the code it does appear that the "rng.select to end with should be before the Next x.

    Suggest you shift the Next x line to the second last and try again.

    You should also know that it will assist you getting a solution to any problem you are stuck on if you include a sample workbook showing the starting point and the expected results. It doesnt have to be a big sample, just enough to make your intentions crystal clear to the volunteers who assist on the forum

    Cheers

    Jmac1947

    1. Please consider clicking on the * Add Reputation if you think this post has helped you
    2. Mark your thread as SOLVED when question is resolved

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,570

    Re: need help on data highlighting

    I'm not sure what you are doing, you say every 3 rows, but your loop is stepping every 6.
    Please Login or Register  to view this content.
    will select rows 2, 3 & 4 for the first iteration, then 8,9 & 10 for the 2nd, etc
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    04-24-2014
    Location
    Taipei, Taiwan
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: need help on data highlighting

    thanks, it worked beautifully. Interestingly I try to play around with putting rng.select before and after Next x and they all seem to work, strange...

+ 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. Replies: 6
    Last Post: 02-16-2013, 07:29 AM
  2. Replies: 2
    Last Post: 02-06-2013, 12:13 AM
  3. Replies: 0
    Last Post: 02-05-2013, 07:51 AM
  4. Help with Highlighting Data
    By John1950 in forum Excel General
    Replies: 3
    Last Post: 03-15-2006, 05:00 PM
  5. Replies: 6
    Last Post: 08-28-2005, 05:05 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