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:
- Vba to copy and paste a range multiple times based on cell value
- Copy paste loop vba - Best answers
- Excel vba to copy and paste rows if multiple conditions is met - Best answers
- If cell contains (multiple text criteria) then return (corresponding text criteria) ✓ - Excel Forum
- You've tried to log in too many times. to protect your account, a temporary block has been placed on logging in. please try again later. ✓ - Facebook Forum
- Based on the values in cells b77 b81 ✓ - Excel Forum
- How to enable vba in excel - Guide
- If cell contains specific text then return value in another cell vba ✓ - Excel Forum
4 replies
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
547
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