I have a change event on a combo box that is being triggered after I have finished and try to save.
The combo is used to lookup descriptions and place the error code in an excel cell.
its generating error 91 runtime error as object variable not found:
its the = Activecell.address line on the if statement that causes the error as there is no active cell selected as the user finished enetering data from the combo.
any ideas?
ComboValue = Me.cbErrorPicker.Value
Dim cell As Range
For Each cell In Range("G11:AC47")
If cell.Address = ActiveCell.Address Then
' "In range"
If (ActiveCell.Value <> "") Then
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes" ' Perform some action.
ActiveCell.Value = ComboValue
Else ' User chose No.
MyString = "No" ' Perform some action.
End If
Else
ActiveCell.Value = ComboValue
End If
Else
' "Not in range"
End If
Next cell
Set cell = Nothing
The combo is used to lookup descriptions and place the error code in an excel cell.
its generating error 91 runtime error as object variable not found:
its the = Activecell.address line on the if statement that causes the error as there is no active cell selected as the user finished enetering data from the combo.
any ideas?
ComboValue = Me.cbErrorPicker.Value
Dim cell As Range
For Each cell In Range("G11:AC47")
If cell.Address = ActiveCell.Address Then
' "In range"
If (ActiveCell.Value <> "") Then
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes" ' Perform some action.
ActiveCell.Value = ComboValue
Else ' User chose No.
MyString = "No" ' Perform some action.
End If
Else
ActiveCell.Value = ComboValue
End If
Else
' "Not in range"
End If
Next cell
Set cell = Nothing