Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formatting based on adjacent cell? Custard Tart Excel Worksheet Functions 2 November 6th 09 02:00 PM
Conditional Formatting Based on Value of Adjacent Cell [email protected] Excel Discussion (Misc queries) 3 December 20th 07 03:40 PM
Conditional Formatting based on adjacent cell value Bill Meacham Excel Discussion (Misc queries) 3 December 11th 07 08:38 PM
Conditional formatting of adjacent cells based on text in cell [email protected] Excel Programming 1 August 8th 06 12:20 AM
How to do a conditional formatting based on an adjacent cell Confused Excel Discussion (Misc queries) 2 January 10th 05 09:55 PM


All times are GMT +1. The time now is 11:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"