Hi Community,
I have a VBA macro for a log record that copies information from a submission form and pastes it in a Log Record data file based on a IF condition. THe condition is partially working where if the condition is true then the data is copied to the log record, But when i try and process a second form it just overwrites the first submission on the log record instead of processing to the next row as it should and did prior to including the IF condition. Any guidance?
Code provided below:
I have a VBA macro for a log record that copies information from a submission form and pastes it in a Log Record data file based on a IF condition. THe condition is partially working where if the condition is true then the data is copied to the log record, But when i try and process a second form it just overwrites the first submission on the log record instead of processing to the next row as it should and did prior to including the IF condition. Any guidance?
Code provided below:
Code:
Public Sub Update()
If Range("AH9").Value = "Yes" Then
Application.ScreenUpdating = False
ActiveSheet.Unprotect
Dim answer As Integer
Dim LUR As Long 'Last Used Row
LUR = Sheets("Data File").Range("A65000").End(xlUp).Offset(1, 0).Row
' This copies data from the Entry Form to the Log Record.
Const ms As Double = 0.000000011574
Range("J9").Copy 'Name
Sheets("Data File").Range("B" & LUR).PasteSpecial Paste:=xlPasteValues
Application.Wait (Now + ms * 250)
'This saves the workbook after you hit the update button
ActiveWorkbook.Save
Application.ScreenUpdating = True
MsgBox "Your complaint case has been submitted."
On Error Resume Next
ElseIf Range("AH9").Value Is Nothing Then
On Error GoTo 0
End If
End Sub