Hello and goodMorning,
Can anyone please help me with this. I have a database in excel that has 2 sheets full of data. I would like if i press a button to update then macro searches in Column O if the words " Req. Feed Set Up" then it get move over to sheet 2 in the workbook.
Sub Feed_set_up()
Dim intLastRow As Long
intLastRow = ActiveSheet.Use dRange.Rows.Cou nt
'Let's start at row 2. Row 1 has headers
X = 4
'Start the loop
Do While X <= intLastRow
'Look for data with 'Feed set up'
If Cells(X, 15) = "Req. Feed Set Up" Then
'copy the row if it contains '
Worksheets("She et1").Rows(X).C opy
'Go to sheet2. Activate it. We want the data here
Worksheets("She et2").Activate
'Find the first empty row in sheet2
erow = Sheet2.Cells(Ro ws.Count, 15).End(xlUp).O ffset(1, 0).Row
'Paste the data here
ActiveSheet.Pas te Destination:=Wo rksheets("Sheet 2").Rows(ero w)
End If
'go to sheet1 again and actvate it
Worksheets("She et1").Activate
'Loop through the other rows with data
X = X + 1
Loop
End Sub
I have this code(above)whic h works great but Everytime i press the update button it copy and paste the rows with the words in Column O overwrites what is in sheet 2. In other words i doesnt not find the fist blank row to paste the data it always starts at row 2 can i get some help with changing this around....
Thanks
Can anyone please help me with this. I have a database in excel that has 2 sheets full of data. I would like if i press a button to update then macro searches in Column O if the words " Req. Feed Set Up" then it get move over to sheet 2 in the workbook.
Sub Feed_set_up()
Dim intLastRow As Long
intLastRow = ActiveSheet.Use dRange.Rows.Cou nt
'Let's start at row 2. Row 1 has headers
X = 4
'Start the loop
Do While X <= intLastRow
'Look for data with 'Feed set up'
If Cells(X, 15) = "Req. Feed Set Up" Then
'copy the row if it contains '
Worksheets("She et1").Rows(X).C opy
'Go to sheet2. Activate it. We want the data here
Worksheets("She et2").Activate
'Find the first empty row in sheet2
erow = Sheet2.Cells(Ro ws.Count, 15).End(xlUp).O ffset(1, 0).Row
'Paste the data here
ActiveSheet.Pas te Destination:=Wo rksheets("Sheet 2").Rows(ero w)
End If
'go to sheet1 again and actvate it
Worksheets("She et1").Activate
'Loop through the other rows with data
X = X + 1
Loop
End Sub
I have this code(above)whic h works great but Everytime i press the update button it copy and paste the rows with the words in Column O overwrites what is in sheet 2. In other words i doesnt not find the fist blank row to paste the data it always starts at row 2 can i get some help with changing this around....
Thanks
Comment