mattyads05
New Member
- Joined
- Aug 1, 2016
- Messages
- 5
Hi all.
Long time listener, 1st time caller.
I am still learning a lot every day with VBA, having only recently returning to a position that requires me to use it again, and I didnt know much before!
I have a UserForm which is populating data entered into 'row 2' on 'sheet 1' which I need to be copied and pasted into the next blank row on 'sheet 1' in a different workbook.
I have managed to get the userform to submit the data by recording a macro of me selecting a row and then opening the new workbook and pasting it, but I cannot find the piece of code that will select an empty row, at least that I can get to work.
I will post what I have below, can anyone help at all please?
Private Sub CommandButton1_Click()
Rows("2:2").Select
Selection.Copy
ChDir "G:\Shortcuts\RCC\TRAINING SERVICES\Training & Quality\Training WIP\Matt"
Workbooks.Open Filename:= _
"G:\Shortcuts\RCC\TRAINING SERVICES\Training & Quality\Training WIP\Matt\Feedback results.xlsm"
Rows("2:2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A3").Select
End Sub
Long time listener, 1st time caller.
I am still learning a lot every day with VBA, having only recently returning to a position that requires me to use it again, and I didnt know much before!
I have a UserForm which is populating data entered into 'row 2' on 'sheet 1' which I need to be copied and pasted into the next blank row on 'sheet 1' in a different workbook.
I have managed to get the userform to submit the data by recording a macro of me selecting a row and then opening the new workbook and pasting it, but I cannot find the piece of code that will select an empty row, at least that I can get to work.
I will post what I have below, can anyone help at all please?
Private Sub CommandButton1_Click()
Rows("2:2").Select
Selection.Copy
ChDir "G:\Shortcuts\RCC\TRAINING SERVICES\Training & Quality\Training WIP\Matt"
Workbooks.Open Filename:= _
"G:\Shortcuts\RCC\TRAINING SERVICES\Training & Quality\Training WIP\Matt\Feedback results.xlsm"
Rows("2:2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A3").Select
End Sub