PDA

View Full Version : Need help with this macro to have it work with Alpha Numeric data



estatefinds
01-01-2017, 10:34 PM
so the (event code) works on numerical data as it is written;

when I select the data in the column A, the macro will highlight the Matching data within the uncolored data in the range H5 to L35. So for example the A1 is selected the macro highlight the A1 that is found within the uncolored data, yellow, then when moved down to the next data in column A, I select the B1 and the A1 in the range H5 to L 35 will turn uncolored and now the B1 will turn yellow and so on.
Also the data range may be longer, for example H5 to L70 at times.

I need this macro to be restructured to work with the Alpha numeric data, Please!!!

I am attaching file

p45cal
01-02-2017, 09:27 AM
Sub test2(currentCell)
With Range("h5").CurrentRegion
For Each cll In .Cells
If cll.Interior.ColorIndex = 6 Then cll.Interior.ColorIndex = xlColorIndexNone
Next cll
Set c = .Find(currentCell.Value, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
If c.Interior.ColorIndex = xlColorIndexNone Then c.Interior.ColorIndex = 6
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then Beep Else test2 Target.Cells(1)
End Sub

estatefinds
01-02-2017, 09:51 AM
Great work!!!! Thank you very much!!! :)