Hello everyone,
i am trying to create a worksheet that will find the value input into column "D" and turn the other cells in that row the same color for example:
before input
after input
currently I have the below code and don't know where to go from here
i am trying to create a worksheet that will find the value input into column "D" and turn the other cells in that row the same color for example:
before input
after input
currently I have the below code and don't know where to go from here
VBA Code:
Private Sub worksheet_Change(ByVal captain As Range)
Dim rangeToChange As Range
Dim colorLocation As Range
Set rangeToChange = Range("F5:F305")
'this makes sure the changed cell is with in the captain column
If Not Intersect(captain, rangeToChange) Is Nothing Then
'this makes sure the cell is not blank before doing something
If captain <> " " Then
'this is if the cell value can't be found in the list then msgbox letting us know
If Range("H5:Q5").Find(Range(captain.Address)) Is Nothing Then
MsgBox "Value not found"
Else
'this is to get the address of the captain in the table
Set colorLocation = Range(Range("H5:Q5").Find(Range(captain.Address)).Address)
'insert code to copy captains cell H5:Q5 formatting and paste it
'just formatting into all cells A-F in table for given row
End If
End If
End If
End Sub