Hi Annette
You will only be able to achieve this via VBA in which case the code would be:
Sub GetColour()
If Range("A1").Interior.ColorIndex = 5 Then
'You code
Else
'Whatever
End If
End Sub
Dave
OzGrid Business Applications
Ok I have this so far:
Sub GetColor()
If Range("A*").Interior.ColorIndex = 50 Then A1 = 50
If Range("A*").Interior.ColorIndex = 10 Then A1 = 10
If Range("A*").Interior.ColorIndex = 42 Then A1 = 42
If Range("A*").Interior.ColorIndex = 40 Then A1 = 40
If Range("A*").Interior.ColorIndex = 35 Then A1 = 35
End Sub
Thank you for your help! I really don't know Visual Basic and have spent a few hours on the web elsewhere trying to find the answer to this - unsucessfully! So here I am again - please help.
What do I do about that pesky little asterisk??? I stuck it in there to represent 'check the current row,' then I need to repeat this going down 2500 rows.
Thank you again!!
Hmmm, I'm not this is what you want, but this code will check the first 2500 Rows of the active sheet. If the entire row has a color index as stated then it will put the Color index number into the first cell of that row.
Sub CheckRows()
Dim i As Integer
Application.ScreenUpdating = False
For i = 1 To 2500
Select Case Rows(i).Interior.ColorIndex
Case 50
Rows(i).Cells(1, 1) = 50
Case 10
Rows(i).Cells(1, 1) = 10
Case 42
Rows(i).Cells(1, 1) = 42
Case 40
Rows(i).Cells(1, 1) = 40
Case 35
Rows(i).Cells(1, 1) = 35
End Select
Next i
Application.ScreenUpdating = True
End Sub
Any Good ?
BTW it is only by chance I scrolled down this far. It is usually a good idea to re-post your question after 24 hours.
Dave
OzGrid Business Applications