Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Excel - Modify a code

Posted on 2013-06-07
Medium Priority
195 Views
Hi - below is code that was provided to copy formulas staring in column F. This code would skip to column and copy the formula until the end. I now need to modify the code so that it starts in column E. What do I need to modify? Below the code is my original questions to which the below code was provided.

Sub CopyX()
Dim i As Long, Start As Long, Finish As Long
Dim rg As Range
Application.ScreenUpdating = False
Start = Columns("F").Column
Finish = Columns("YJ").Column - Start
Set rg = Range("F696:F1356")
For i = 3 To Finish Step 3
rg.Copy
rg.Offset(0, i).PasteSpecial xlPasteFormulas
Next
End Sub

Original question
Hi, I want to copy the contents from Column X1 to X2, X3,X4 till the end of my last column. X1 starts in column F696 and it goes down to F1356. The last column is YJ. There are two empty columns between each X. Can this be down with a macro, a loop, or code?
conernesto.

X1      b      b      X2      b      b      X3      b      b      X4
100                  100                  100                  100
200                  200                  200                  200
300                  300                  300                  300
0
Question by:Conernesto
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 49

Accepted Solution

Martin Liss earned 2000 total points
ID: 39229737
Does this work?
``````Sub CopyX()
Dim i As Long, Start As Long, Finish As Long
Dim rg As Range
Application.ScreenUpdating = False
Start = Columns("E").Column
Finish = Columns("YJ").Column - Start
Set rg = Range("E696:E1356")
For i = 3 To Finish Step 3
rg.Copy
rg.Offset(0, i).PasteSpecial xlPasteFormulas
Next
End Sub
``````
0

LVL 49

Expert Comment

ID: 39230634
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
###### Suggested Courses
Course of the Month5 days, 6 hours left to enroll