Excel VBA copy and paste loop with logic condition
Solved/Closed
Yogibearv
Posts
2
Registration date
Monday October 20, 2014
Status
Member
Last seen
October 21, 2014
-
Updated on Jan 30, 2019 at 08:33 AM
Yogibearv - Oct 28, 2014 at 04:27 PM
Yogibearv - Oct 28, 2014 at 04:27 PM
Related:
- Copy and paste loop in vba based on cell values
- Vba to copy and paste a range multiple times based on cell value - Best answers
- Copy paste loop vba - Best answers
- Based on the values in cells b77 b81 ✓ - Excel Forum
- Why can't i copy and paste on instagram ✓ - Instagram Forum
- Fill adjacent cell with number from text answer ✓ - Excel Forum
- Vba case like - Guide
- Based on the cell values in cells b77 - Excel Forum
4 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
552
Oct 28, 2014 at 12:19 PM
Oct 28, 2014 at 12:19 PM
Hi Yogibearv,
So you use a formula for D5, that makes more sense. Try this code:
Best regards,
Trowa
So you use a formula for D5, that makes more sense. Try this code:
Sub RunMe() Dim lRow, x As Integer lRow = Range("I" & Rows.Count).End(xlUp).Row x = 6 Do x = x + 1 Range("B" & x).Value = Range("I" & x).Value Range("I" & x).ClearContents Loop Until IsEmpty(Range("I" & x + 1)) Or x = lRow Or Range("D5").Value = "OK" End Sub
Best regards,
Trowa