Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I have this code:
If the value in column 6 of wshfac.range("A:H") of the looked up value FacB = "N", which in my sample ase it does ...
The code in blue will change the font colour of the contents in range AB24:AE27 to grey, and the code in red will merge a series of cell ranges.
The merging of range AC24:AE24 and AC26:AE26 is not working. Everything else does. The sheet is not protected.
Code:
If Application.VLookup(FacB, wshfac.Range("A:H"), 6, False) = "N" Then
With .Range("AB24:AE27")
.Font.Color = RGB(224, 224, 224)
'.Locked = True
End With
End If
With .Range("AB24:AB24, AC24:AE24, AB25:AD25, AB26:AB26, AC26:AE26, AB27:AD27, AA27:AD27, AE27:AE27")
.MergeCells = True
.Locked = True
End With
If the value in column 6 of wshfac.range("A:H") of the looked up value FacB = "N", which in my sample ase it does ...
The code in blue will change the font colour of the contents in range AB24:AE27 to grey, and the code in red will merge a series of cell ranges.
The merging of range AC24:AE24 and AC26:AE26 is not working. Everything else does. The sheet is not protected.