Hi
I'm using the below code in VBA in my other sheets and it works perfectly fine. However, I want to use it for my new sheet but it doesn't work. The cells are merged F25:G26 is blank than system shouldn't allow the user to input anything F31:G32. The cells are merged. Please can someone guide me how should I do that.
I'm using the below code in VBA in my other sheets and it works perfectly fine. However, I want to use it for my new sheet but it doesn't work. The cells are merged F25:G26 is blank than system shouldn't allow the user to input anything F31:G32. The cells are merged. Please can someone guide me how should I do that.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.CountLarge > 1 Then Exit Sub
If Not Intersect(Target, Columns("A:B")) Is Nothing Then Exit Sub
Dim cel As Range: Set cel = Target.Offset(, -2)
If Not Intersect(Target, Range("F31:G32")) Is Nothing Then
If cel = "" Then
cel.Select
MsgBox "Input data first above"
End If
End If
Application.CutCopyMode = False
End Sub