Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Formatting based on data in adjacent cell & restrict save without required data
In the range of (B23:L147). Col B has header "W/P/L/F", Col F has
header "Customer" and Col L has header "Amount". If the user enters any data in any row in the range in column F, without entering data into the adjacent columns B and L, I want the cells n that same row in Col's B and L to highlight red. I also want to make sure they cannot "save" the file without filling in those cells. Can anyone help me? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Formatting based on data in adjacent cell & restrict save without required data
On Aug 28, 8:18 pm, bjohnson wrote:
In the range of (B23:L147). Col B has header "W/P/L/F", Col F has header "Customer" and Col L has header "Amount". If the user enters any data in any row in the range in column F, without entering data into the adjacent columns B and L, I want the cells n that same row in Col's B and L to highlight red. I also want to make sure they cannot "save" the file without filling in those cells. Can anyone help me? Format Conditional Formatting. In B23 and L23 and drag down: Formula is:=AND(F23<"",L23="",B23="") and add desired formatting. To stop saving, add formula in M23 (or anywhere) =IF(AND(F23<"",B23="",L23=""),1,"") and drag down and then in Workbook BeforeSave event, Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If WorksheetFunction.Sum(Sheet1.Range("M23:M26")) 0 Then MsgBox "Please fill in gaps" Cancel = True End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional formatting based on adjacent cell? | Excel Worksheet Functions | |||
Conditional Formatting Based on Value of Adjacent Cell | Excel Discussion (Misc queries) | |||
Conditional Formatting based on adjacent cell value | Excel Discussion (Misc queries) | |||
Conditional formatting of adjacent cells based on text in cell | Excel Programming | |||
How to do a conditional formatting based on an adjacent cell | Excel Discussion (Misc queries) |