+ Reply to Thread
Results 1 to 5 of 5

Colour coded data, how do I use VBA to separate them?

  1. #1
    Registered User
    Join Date
    10-28-2020
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    3

    Colour coded data, how do I use VBA to separate them?

    I'm relatively new to VBA coding and would like some help to separate data.

    I have an Excel file containing data that are colour coded in ranges.

    i.e. Cell B2:B10 Red, Cell B11:B20 Blue, Cell B30:31 Red. Cells In between these ranges are not coloured. I would like to separate these data and put them in a separate worksheet. So, I'll need to loop across the column, and select the first range that is coloured Red. Then copy those value into a new sheet. Then move on to the next colour (blue), and then copy it into another sheet. Then move on to the next colour (red), and copy it into another sheet.

    May I know how to even find a code that can help to select the ranges that are coloured (interior colour)?

    The reason I'm asking for the range is that the data that I require is not only in column B. Column C, D and there are other worksheets in the workbook too. But they all correspond to the rows that have been colour coded. But only column B has the colour codes.

    i.e. Cell B10:B20, C10:C20, E10:E20 are of the same batch, only that columns B,C and E measures different parameters.

    From the photo, each alternate colour is one batch. And I would like to separate them according to the batch. Not by colour.


    Sorry, this is my first post and I didn't know cross-posting would be an issue. I'm just stuck as to how I can cycle through the columns by using the colour of the cells. My apologies if I've broken a rule.
    I've asked the same question on stackoverflow.


    Attachment 701714
    Attached Files Attached Files
    Last edited by faiezin95; 10-28-2020 at 10:55 AM. Reason: I'm new, and Ii just saw the notice where cross-posting is discouraged.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Colour coded data, how do I use VBA to separate them? [closed]

    Is this solved?

    Your version of Office is 365 (days in a year), not 360 (degrees in a circle).

    Provide the URL of the post on StackOverflow - you will need to post it in a couple of sections with gaps.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-28-2020
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Colour coded data, how do I use VBA to separate them? [closed]

    Hello! Oops sorry, I'll amend the Office 365.

    Nope it's not solved yet. I do not know how to alternate between red and blue codes.

    i.e. My code will copy all the cells highlighted in red and all the ones in blue. But I need the code to know that once the cell isn't red in colour (either it's blue or no colour), then it's a new batch and it'll copy and paste into another sheet.

    Here is the link below from stackoverflow
    stackoverflow.com/questions/64571326/colour-coded-data-how-do-i-use-vba-to-separate-them[/url]

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Colour coded data, how do I use VBA to separate them? [closed]

    So why did you type CLOSED in the thread title? I suggest you edit that out if you want some help!

  5. #5
    Registered User
    Join Date
    10-28-2020
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Colour coded data, how do I use VBA to separate them?

    Hello, my apologies. It's my first post... and I don't even remember writing closed there...

+ 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. Can anyone help me with a sequentially colour coded tab?
    By tow in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2020, 07:58 AM
  2. X Y Scatter Chart, with Labels & colour coded markers
    By Stephanieaw in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-25-2018, 08:54 AM
  3. Replies: 3
    Last Post: 11-30-2016, 11:18 AM
  4. Help Creating a Colour-Coded Monitoring Sheet
    By oyoung92 in forum Excel General
    Replies: 16
    Last Post: 10-11-2016, 04:47 PM
  5. colour coded points depending on error amount
    By sapster86 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-28-2008, 02:16 PM
  6. Colour coded Validation Lists?
    By darklord in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 04-12-2007, 10:02 AM
  7. [SOLVED] rating cells 1-5 colour coded HOW?
    By treetop40 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-09-2005, 08:05 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