I have the following macro with me which is letting me copy data till the next blank row.
PHP Code:
Public Sub CopyRows()
Sheets("Raw Data").Select
' Find the last row of data
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
' Loop through each row
For x = 2 To FinalRow
' Decide if to copy based on column H
ThisValue = Cells(x, 1).Value
If ThisValue <> 0 Then
Cells(x, 1).Resize(1, 33).Copy
Sheets("English").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("Raw Data").Select
ElseIf ThisValue <> 0 Then
Cells(x, 1).Resize(1, 33).Copy
Sheets("Hindi").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("Hindi").Select
End If
Next x
End Sub
But i need it like if it founds a blank row in the raw data sheet it should copy the data from the next blank row to another sheet.
I mean, it should start the validation and copy the data first to English sheet till A13. Next it found blank row. so again the data from A17 to A29 to be copied in Hindi and the next rows to be copied to English & Hindi.
This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.
Thread Closed.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Bookmarks