The code shown below is for a Button a user will click after a “data input” session in order to post the record.
The code works as written for testing purposes to a specific target but I need to have the copied range pasted to the next empty row of a record stack that was already manually-started at A501.
Here is the Code:
Private Sub CommandButton3_Click()
Worksheets(“les”).Activate
Range(“Ac3:aC24”).Select
Range(“Ac3:aC24”).Copy
Range(“a5000”).PasteSpecial xlPasteValuesAndNumberFormats, SkipBlanks:=False, Transpose:=True
Worksheets(“les”).Activate
Range(“af1”).Select
Range(“ac4”).Select
End Sub
The first group copies and pastes the record, and the second grouip returns the input screen for further input.
How can the code be written so that the next “empty” row is found before the range of copied cells is allowed to be pasted?
The idea for this is to use a conditional statement to test for cell content beginning at A501; if not empty, it advances to A502 then A503 and-so-on until the next empty cell is found. Once found, the copied range is pasted as the next completed record.
I am familiar in doing these manually, but am not in knowing how to write program instruction for automated functions like this one.
Thank you for your pending response