PC Review


Reply
Thread Tools Rate Thread

Conditional Formatting based on data in adjacent cell & restrict save without required data

 
 
bjohnson
Guest
Posts: n/a
 
      28th Aug 2007
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?

 
Reply With Quote
 
 
 
 
stjori@hotmail.com
Guest
Posts: n/a
 
      28th Aug 2007
On Aug 28, 8:18 pm, bjohnson <beth.john...@colonialwebb.com> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formatting based on adjacent cell? Custard Tart Microsoft Excel Worksheet Functions 1 6th Nov 2009 01:53 PM
Conditional Formatting Based on Value of Adjacent Cell f252863@hotmail.com Microsoft Excel Misc 3 20th Dec 2007 03:40 PM
Conditional Formatting based on adjacent cell value Bill Meacham Microsoft Excel Misc 3 11th Dec 2007 08:38 PM
Conditional formatting of adjacent cells based on text in cell elderain@gmail.com Microsoft Excel Programming 1 8th Aug 2006 12:20 AM
How to do a conditional formatting based on an adjacent cell =?Utf-8?B?Q29uZnVzZWQ=?= Microsoft Excel Misc 2 10th Jan 2005 09:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:34 AM.