C
Chris
Hi, could someone please help me with the following code: when I click
on the OK button the code simply exits the subroutine. What I need is
for the user to click on the cancel button and then the subroutine
exits. However, if the user clicks on the OK buton, I need the
subroutine to continue to the end.
Any help would be greatly appreciated.
Kind regards,
Chris.
Sub copylastrowtocolVdown()
Dim lr As Long
Application.ScreenUpdating = False
MsgBox "Copy Last Record Down when the last Position Data record has
been populated in readiness to be copied into the last blank row
below.", vbOKCancel, "Copy Last Record Down"
If vbCancel Then Exit Sub
lr = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lr, 1).Resize(, 22).Copy Cells(lr, 1).Resize(2)
Application.ScreenUpdating = True
End Sub
on the OK button the code simply exits the subroutine. What I need is
for the user to click on the cancel button and then the subroutine
exits. However, if the user clicks on the OK buton, I need the
subroutine to continue to the end.
Any help would be greatly appreciated.
Kind regards,
Chris.
Sub copylastrowtocolVdown()
Dim lr As Long
Application.ScreenUpdating = False
MsgBox "Copy Last Record Down when the last Position Data record has
been populated in readiness to be copied into the last blank row
below.", vbOKCancel, "Copy Last Record Down"
If vbCancel Then Exit Sub
lr = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lr, 1).Resize(, 22).Copy Cells(lr, 1).Resize(2)
Application.ScreenUpdating = True
End Sub