[vba]. read values in color only on vba.

montecarlo2012

Well-known Member
Joined
Jan 26, 2011
Messages
984
Office Version
  1. 2010
Platform
  1. Windows
Hi everyone.
How to read only the values with colors in a column and display this values in a row in another sheet, small example don't need xl2BB I think, so couple images can show my point.
this is what I have on sheet2
1596656309381.png

and this is the results I am expecting on sheet3
1596656341932.png

Please, Can anyone tell me how to do this.
thank you.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Excellent DanteAmor. Thank you for your help.

You could simplify like this:
VBA Code:
Sub Macro8()
  Dim c As Variant, d As Range, j As Long
  
  j = 2
  For Each c In Array("I", "L", "O", "R", "U", "X", "AA")
    For Each d In Sheet2.Range(c & 1, Sheet2.Range(c & Rows.Count).End(3))
      If d.Interior.ColorIndex <> xlNone Then Sheet3.Cells(j, Sheet3.Cells(j, Columns.Count).End(1).Column + 1) = d
    Next d
    j = j + 1
  Next c
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,124
Messages
6,128,990
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top