copying one column to another in vba excel

Posted on 2012-09-07
Last Modified: 2012-09-07

I have a column (A) in an Excel spreadsheet which I want to copy to another column (B).

Column A contains calculated values. I only want to copy the values from column A to column B (not the formulas).

Can anybody give me some VBA code which will do this?

I have named the range of column A as "end" and column B as "previous".

Many thanks in advance

Question by:IssacJones
    LVL 5

    Accepted Solution

    If the code is in the sheet of where you have the ranges, you can use

    Range("Previous").Value = Range("End").Value

    Open in new window

    Otherwise, you'll need to qualify the sheet also:

    Sheets("Sheet1").Range("Previous").Value = Sheets("sheet1").Range("End").Value

    Open in new window

    Does this help?
    LVL 12

    Expert Comment

    by:Anuradha Goli
    Worksheets("Sheet1").Range("Previous").PasteSpecial xlPasteValues

    Author Closing Comment


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
    The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
    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…

    729 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

    16 Experts available now in Live!

    Get 1:1 Help Now