View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Require entry in one cell if data in another

presented the following explanation :
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...


Try...

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("WhatsItsname") 'substitute actual value
If Not .Range("B17") = "" Then
.Range("I17") = myValue1 'substitute actual value
.Range("L17") = myValue2 'substitute actual value
End If 'Not .Range("B17") = ""
End With
End Sub

--
Garry

Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc