Check column by column to see if Column(x) Row4 is Interior Color is Gray color RGB(220, 230, 241)
Check all rows in Column(x) for content
If there is content, copy the content to Column(x), Row 2
Check to see if the currently read contents are the same as the previously read contents
If they are not the same (No Duplicates)
Write the contents to Cell Column (x), Row 2
excel vba check column for value
excel vba check column for duplicates
Example using the screen shot in the document…
1) Column “H” Row “4” contains the characters “CT_001” in a cell that has a gray background RGB(220,230,241)
2) Check (read) the next row in Column “H”. It contains the characters “No”.
3) Write the Characters “No” into a “read” variable.
4) Write that variable to Column “H” Row “2”
5) Read the next row. In this case “No Response Data Found”
6) Check to see if the characters are equal to the “read” variable.
7) If they are not write the characters to Column “H” Row “2”
8) Move the characters “No Response Data Found” to the ‘Read” variable ( want to ensure duplicates do not get written.
9) In this case Column “H” Row “2” will now contain the Characters “No” and “No Response Data Found”
Code so far…
Sub FindGrayDim col As Range, rg As Range Application.ScreenUpdating = False Set rg = ActiveSheet.UsedRangeIf rg.Column <> 1 Then Range(Cells(1, 1), Cells(1, rg.Column - 1)).EntireColumn.Hidden = TrueRange(Cells(1, rg.Column + rg.Columns.Count), Cells(1, ActiveSheet.Columns.Count)).EntireColumn.Hidden = TrueFor Each col In ActiveSheet.UsedRange.Columns If col.EntireColumn.Cells(4, 1).Interior.Color <> RGB(220, 230, 241) Then _ NextEnd Sub
Any help I can get with this would be greatly appreciated.
Please let me if you need more details or information.
Thanks in advance.
Please see the attached word file for problem re-statement and screenshot examples. Your help with this would be greatly appreciated.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
-Mike Kapnisakis, Warner Bros
With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. It’s like crowd-sourced consulting.
We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed.
We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Our experts volunteer their time to help other people in the technology industry learn and succeed.