Solved

Copy column two rows over

Posted on 2014-02-14
2
127 Views
Last Modified: 2014-02-20
I need to copy over left 2 columns not one.   I need help changing this code.

 Sheets("Sheet1").Select
 Range("C1").Select
Selection.SpecialCells(xlBlanks).Delete shift:=xlToLeft
0
Comment
Question by:leezac
2 Comments
 
LVL 12

Assisted Solution

by:Harry Lee
Harry Lee earned 250 total points
Comment Utility
leezac,

do you mean these codes?

Dim I As Long
    For I = 2 To Range("J" & Rows.Count).End(xlUp).Row
        If Range("J" & I).Value <> "R" Then
            Range("I"& I).Value = Range("J" & I).Value
            Range("J" & I).Value = ""
        End If
    Next I

Open in new window


Just change it to

Dim I As Long
    For I = 2 To Range("J" & Rows.Count).End(xlUp).Row
        If Range("J" & I).Value <> "R" Then
            Range("H"& I).Value = Range("J" & I).Value
            Range("J" & I).Value = ""
        End If
    Next I

Open in new window

0
 
LVL 29

Accepted Solution

by:
gowflow earned 250 total points
Comment Utility
try this

Sheets("Sheet1").Select
 Range("H1").Select
Range(Selection.Offset(0, -2), Selection.Offset(0, -1)).Delete shift:=xlToLeft

Open in new window


gowflow
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now