Solved

Copy column two rows over

Posted on 2014-02-14
2
128 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
ID: 39860644
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
ID: 39863042
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
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.

785 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