Excel 2003
What i'd like to do is, that if say cell A4 had any sort of text, number or date in it, then this then makes cell B4 mandatory. I've created some VBA that makes cell A4 mandatory:
Option Explicit
Dim Mandatory As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Cells.Count > 1 Then Exit Sub
Select Case Target.Address
Case "$A$4"
Set Mandatory = Target
Case Else
If Not Mandatory Is Nothing Then
If Mandatory = "" Then
Mandatory.Select
MsgBox "You cannot leave this cell blank"
End If
End If
End Select
End Sub
However i need some help with how to make it so that if there is anything in A4 then B4 is mandatory. Help?
What i'd like to do is, that if say cell A4 had any sort of text, number or date in it, then this then makes cell B4 mandatory. I've created some VBA that makes cell A4 mandatory:
Option Explicit
Dim Mandatory As Range
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Cells.Count > 1 Then Exit Sub
Select Case Target.Address
Case "$A$4"
Set Mandatory = Target
Case Else
If Not Mandatory Is Nothing Then
If Mandatory = "" Then
Mandatory.Select
MsgBox "You cannot leave this cell blank"
End If
End If
End Select
End Sub
However i need some help with how to make it so that if there is anything in A4 then B4 is mandatory. Help?