Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Require entry in one cell if data in another

I am trying to make it so that if there is ANY data in cell b17, then
there MUST be data entered in I17 and L17. Can anyone pleae help me
with this? I want these to be "beforeprint" events...
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Require entry in one cell if data in another

Hi
One more for you to try.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim a As Range, b As Range, c As Range
Set a = Sheets("sheet1").Range("B17") 'You need to change the name of the
sheet is it's not sheet1
Set b = Sheets("sheet1").Range("i17")
Set c = Sheets("sheet1").Range("L17")
If a "" Then
If b = "" Or c = "" Then
MsgBox "You need to fill in the two cells i17 & L17"
Cancel = True
End If
End If
End Sub
HTH
Cimjet

wrote in message
...
I am trying to make it so that if there is ANY data in cell b17, then
there MUST be data entered in I17 and L17. Can anyone pleae help me
with this? I want these to be "beforeprint" events...


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Require entry in one cell if data in another

Hi
Ignore the first one because of text overwrap
One more for you to try.
'You need to change the name of the
sheet if it's not "sheet1"

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim a As Range, b As Range, c As Range
Set a = Sheets("sheet1").Range("B17")
Set b = Sheets("sheet1").Range("i17")
Set c = Sheets("sheet1").Range("L17")
If a "" Then
If b = "" Or c = "" Then
MsgBox "You need to fill in the two cells i17 & L17"
Cancel = True
End If
End If
End Sub

HTH
Cimjet

wrote in message
...
I am trying to make it so that if there is ANY data in cell b17, then
there MUST be data entered in I17 and L17. Can anyone pleae help me
with this? I want these to be "beforeprint" events...


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
Require an entry in a cell Erika Excel Discussion (Misc queries) 3 September 25th 09 09:15 PM
How do I require data entry in a combo box in Excel? noviceql Excel Programming 1 November 14th 08 04:25 PM
Require data entry in column before moving to next cell [email protected] Excel Programming 1 April 27th 08 02:39 PM
How do I require data entry in a cell before moving to the next ce CindyB Excel Worksheet Functions 3 April 26th 08 04:18 PM
Require cell entry Bernie Deitrick Excel Programming 0 June 24th 04 02:43 PM


All times are GMT +1. The time now is 06:31 PM.

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

About Us

"It's about Microsoft Excel"