Trevor3007
Well-known Member
- Joined
- Jan 26, 2017
- Messages
- 675
- Office Version
- 365
- Platform
- Windows
evening,
i have the code below (it runs within more code, I just extracted & added the 'end sub')
Works great in the workbook that it was originally designed for.
however, I would wish to use it in another workbook,
The red text above , is it possible to use a wildcard IE *locked' and it will trigger the colour change?
I tried , but no luck. Hoping someone has the knowledge?
Fingers crossed .
i have the code below (it runs within more code, I just extracted & added the 'end sub')
Works great in the workbook that it was originally designed for.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Dim rng As Range
For Each rng In Range("h3:h8000")
Select Case rng.Value
Case "Build Completed"
With Range("A" & rng.Row).Resize(1, 22)
.Interior.ColorIndex = 4
.Font.Bold = True
End With
Case "Swapped-Out"
With Range("A" & rng.Row).Resize(1, 22)
.Interior.ColorIndex = 22
.Font.Bold = True
End With
Case "Build Started"
With Range("A" & rng.Row).Resize(1, 22)
.Interior.ColorIndex = 6
.Font.Bold = True
End With
Case "Device Not Received"
With Range("A" & rng.Row).Resize(1, 22)
.Interior.ColorIndex = 28
.Font.Bold = True
End With
Case "Emailed Requested For SCCM Check"
With Range("A" & rng.Row).Resize(1, 22)
.Interior.ColorIndex = 38
.Font.Bold = True
End With
Case "Desktop UAD - On Hold ATM"
With Range("A" & rng.Row).Resize(1, 22)
.Interior.ColorIndex = 44
.Font.Bold = True
End With
Case "Device With Build Engineer"
With Range("A" & rng.Row).Resize(1, 22)
.Interior.ColorIndex = 40
.Font.Bold = False
End With
Case ""
With Range("A" & rng.Row).Resize(1, 22)
.Interior.ColorIndex = xlNone
.Font.Bold = False
End With
End Select
Next rng
Application.ScreenUpdating = True
End sub
however, I would wish to use it in another workbook,
Code:
[COLOR=#ff0000]For Each rng In Range("h3:h8000")
Select Case rng.Value
Case "3rd floor engineer door - locked"[/COLOR]
The red text above , is it possible to use a wildcard IE *locked' and it will trigger the colour change?
I tried , but no luck. Hoping someone has the knowledge?
Fingers crossed .