Hi,
I'm trying to save a range using an activeX button but the VB code I am using is giving me an error message saying the variable is not defined.
Can anyone help?
I'm trying to save a range using an activeX button but the VB code I am using is giving me an error message saying the variable is not defined.
Can anyone help?
VBA Code:
Private Sub cmdSave_Click()
Application.ScreenUpdating = False
Dim iRow As Long
iRow = Sheets("Admin").Range("B1048576").End(x1up).Row + 1
If validationForm = True Then
With ThisWorkbook.Sheets("Admin")
.Range("B" & iRow).Value = iRow - 1
.Range("C" & iRow).Value = txtRefNumber.Value
.Range("D" & iRow).Value = txtDateOutcome.Value
.Range("E" & iRow).Value = txtDateShelf.Value
.Range("F" & iRow).Value = txtDM.Value
.Range("G" & iRow).Value = cmbServedBy.Text
.Range("H" & iRow).Value = txtDateServed.Value
End With
Call Reset
Else
Application.ScreenUpdating = True
Exit Sub
End If
Application.ScreenUpdating = True
End Sub