+ Reply to Thread
Results 1 to 5 of 5

Locate a Cell (Using VBA) Based On Its Formatting

  1. #1
    Registered User
    Join Date
    07-01-2014
    Location
    London, England
    MS-Off Ver
    13
    Posts
    3

    Locate a Cell (Using VBA) Based On Its Formatting

    Is there a way to use find or similar to locate, say, the first cell in row 1 where cells.interior.colourindex=4 ?

    Basically, I have to define ranges in 1000+ sheets and the ONLY things that are constant across all the sheets that I can use as a starting point are that the top left cell has the same background colour and they all start on row 1. The contents are different, the cell addresses are different, the ranges won't be the same size...

    If you have a better idea as to how to start and/or if the formatting search definitely doesn't work, please let me know. This is all I've been able to come up with so far.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Locate a Cell (Using VBA) Based On Its Formatting

    Something like:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-01-2014
    Location
    London, England
    MS-Off Ver
    13
    Posts
    3

    Re: Locate a Cell (Using VBA) Based On Its Formatting

    Amazing, thank you!

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Locate a Cell (Using VBA) Based On Its Formatting

    Actually, it would probable be more useful to return a range, rather than a string, wouldn't it?

    So, try:
    Please Login or Register  to view this content.

    And a test / example:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Locate a Cell (Using VBA) Based On Its Formatting

    Just for fun, another:

    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)

Similar Threads

  1. Locate and colour cell based on a number of criteria in other cells
    By ackp in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-23-2013, 10:05 AM
  2. Locate row above cell with specific text, and apply formatting?
    By HelenW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2009, 11:09 AM
  3. Locate duplicates in a work book by using conditional formatting
    By Pchris in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-03-2006, 02:00 AM
  4. Replies: 1
    Last Post: 11-17-2005, 02:35 PM
  5. Locate a Cell based upon criteria
    By Stan in forum Excel General
    Replies: 1
    Last Post: 09-23-2005, 11: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