I’m working with this code as part of a different worksheet, trying to see if it will work. I finally got it to work and then all of a sudden it stops working telling me my formula is blank when I debug. I have various vac, off, and 1’s in range A1:A4 --------Very confused?????
Private Sub CommandButton1_Click()
Dim rowfirst As Variant
Dim rowlast As Variant
Range("a1:a4").Select
rowfirst = ActiveCell.Address
Range(ActiveCell.Address).End(xlDown).Select
rowlast = ActiveCell.Address
MsgBox "first address" & rowfirst
MsgBox "lastaddress" & rowlast
MsgBox "Range" & rowfirst & ":" & rowlast
If Range("e12").Formula = "=SUMPRODUCT(COUNTIF(rowfirst & : & rowlast,{""vac"",""ptk"",""1"",""sck"",""off""})*{1,1,0.25,1,1})" >= 3 Then
MsgBox "CAN NOT WORK"
Else
MsgBox "CAN WORK"
End If
End Sub
Private Sub CommandButton1_Click()
Dim rowfirst As Variant
Dim rowlast As Variant
Range("a1:a4").Select
rowfirst = ActiveCell.Address
Range(ActiveCell.Address).End(xlDown).Select
rowlast = ActiveCell.Address
MsgBox "first address" & rowfirst
MsgBox "lastaddress" & rowlast
MsgBox "Range" & rowfirst & ":" & rowlast
If Range("e12").Formula = "=SUMPRODUCT(COUNTIF(rowfirst & : & rowlast,{""vac"",""ptk"",""1"",""sck"",""off""})*{1,1,0.25,1,1})" >= 3 Then
MsgBox "CAN NOT WORK"
Else
MsgBox "CAN WORK"
End If
End Sub