Macro that copy/pastes rows based on a certain condition on SAME sheet.
Solved/Closed
jaime.mmm
-
Updated on Feb 24, 2021 at 02:09 AM
TrowaD
TrowaD
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Related:
- Macro that copy/pastes rows based on a certain condition on SAME sheet.
- Macro to add/remove rows based on highest # in group of cells ✓ - Forum - Excel
- Excel macro copy and paste into next empty row - Guide
- Macro to copy/paste down X times (where X is the number of rows) ✓ - Forum - Excel
- MACRO to copy / paste cell text down various rows ✓ - Forum - Excel
- A macro to copy/paste a cell and other cells in the same row ✓ - Forum - Excel
1 reply
TrowaD
Feb 25, 2021 at 12:05 PM
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Feb 25, 2021 at 12:05 PM
Hi Jaime,
You didn't provide much details.
The 6 columns you mention are columns A to F in the code below. When the 6th column (F) is empty, then that row (columns A to E) are copied to column H at the first available row (occupying columns H to L).
Here is the code:
Let us know if further assistance is desired.
Best regards,
Trowa
You didn't provide much details.
The 6 columns you mention are columns A to F in the code below. When the 6th column (F) is empty, then that row (columns A to E) are copied to column H at the first available row (occupying columns H to L).
Here is the code:
Sub RunMe() For Each cell In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row) If cell.Offset(0, 5).Value = vbNullString Then Range(Cells(cell.Row, "A"), Cells(cell.Row, "E")).Copy Range("H" & Rows.Count).End(xlUp).Offset(1, 0) End If Next cell End Sub
Let us know if further assistance is desired.
Best regards,
Trowa