How to insert columns until a cell condition is met
Closed
bubblebluez
-
Sep 28, 2016 at 08:11 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Oct 4, 2016 at 10:59 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Oct 4, 2016 at 10:59 AM
Related:
- How to insert columns until a cell condition is met
- How to insert a checkmark in word - Guide
- How to insert photo in word for resume - Guide
- How to insert watermark in word - Guide
- How to insert @ in a laptop - Guide
- Where is insert key on laptop keyboard - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Oct 4, 2016 at 10:59 AM
Oct 4, 2016 at 10:59 AM
Hi Bubblebluez,
Try the following code:
Best regards,
Trowa
Try the following code:
Sub RunMe() Dim x As Integer Sheets("Project A").Select Columns("C:C").Insert Range("C1").Value = Sheets("Menu").Range("C10").Value x = 3 Do Until Cells(1, x).Value = Cells(1, x + 1).Value + 1 Columns(x + 1).Insert Cells(1, x + 1).Value = Cells(1, x).Value + 1 x = x + 1 Loop End Sub
Best regards,
Trowa