Hi All,
There are many "move to sheet2" answers on the forum but most depend on the user selecting the data themselves I would like to avoid this if possible.
I have found this code and adapted it to suit my requirements but it stops working at the line in bold, can anyone explain please?
There may be other ways of achieving my goal but I need to use VBA code so that the user (My Wife) does not need to do anything technical, like using filters/cut & Paste etc.
I have a "Membership list" of addresses etc. and monies paid, what I am doing is when they pay their subs I need to move the row of data to Sheet2 from Sheet1.
A "Paid" column has the money in, all zeros until payment is made, I then use that value to move the rows of data for each individual.
Some of the rows have empty cells in does this make a difference or is it ok?
EXCEL 2003
I hope my explanation is clear
Thanks in advance
Roger
There are many "move to sheet2" answers on the forum but most depend on the user selecting the data themselves I would like to avoid this if possible.
I have found this code and adapted it to suit my requirements but it stops working at the line in bold, can anyone explain please?
There may be other ways of achieving my goal but I need to use VBA code so that the user (My Wife) does not need to do anything technical, like using filters/cut & Paste etc.
I have a "Membership list" of addresses etc. and monies paid, what I am doing is when they pay their subs I need to move the row of data to Sheet2 from Sheet1.
A "Paid" column has the money in, all zeros until payment is made, I then use that value to move the rows of data for each individual.
Some of the rows have empty cells in does this make a difference or is it ok?
Sub myMOVE()
'Let's start at row 2. Row 1 has headers
x = 2
'Start the loop
Do While Cells(x, 1) <> ""
'Look for data with 'value of 5 or more'
If Cells(x, 1) > "5" Then
'copy the row if it contains '6 or more'
Worksheets("Sheet1").Rows(x).Copy
'Go to sheet2. Activate it. We want the data here
Worksheets("Sheet2").Activate
'Find the first empty row in sheet2
erow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
'Paste the data here
ActiveSheet.Paste Destination:=Worksheets("Sheet2").Rows(erow)
End If
'go to sheet1 again and actvate it
Worksheets("Sheet1").Activate
'Loop through the other rows with data
x = x + 1
Loop
End Sub
EXCEL 2003
I hope my explanation is clear
Thanks in advance
Roger
Last edited: