Help on a solution would be greatly appreciated. The board has been very helpful to date and much appreciated.
I am filtering a list and copying it from one sheet to another. I am using a macro that finds the next empty row and pastes to it. However, I want to be able to limit the number of rows that can be pasted. For example, I may want to limit the macro to only pasting eight times. How do I add this to this macro? Thank you to anyone who can help. It could be a disaster if I allow too many rows to paste.
Public Sub copyitems()
''
'
Application.Goto Reference:="group1"
Selection.Copy
Sheets("Sheet2").Select
Sheets("Sheet2").Range("G639").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
Range("G639").Select
End Sub
I am filtering a list and copying it from one sheet to another. I am using a macro that finds the next empty row and pastes to it. However, I want to be able to limit the number of rows that can be pasted. For example, I may want to limit the macro to only pasting eight times. How do I add this to this macro? Thank you to anyone who can help. It could be a disaster if I allow too many rows to paste.
Public Sub copyitems()
''
'
Application.Goto Reference:="group1"
Selection.Copy
Sheets("Sheet2").Select
Sheets("Sheet2").Range("G639").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
Range("G639").Select
End Sub