+ Reply to Thread
Results 1 to 3 of 3

Copy, Paste Special Values

Hybrid View

  1. #1
    Registered User
    Join Date
    06-22-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Copy, Paste Special Values

    I have formulas in 4 columns

    D,E,F & G

    For column 'F' I want to have a macro that willl copy and paste speacial values on click of a button. I tried recording a macro but it copy and paste special on all the columns with a formula and not just column 'F'

    Does anybody know the vba code to just copy paste special values on column F:F

    Thanks in advance for you help

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Copy, Paste Special Values

    Hi,

    Try this:

    Sub a()
    Dim rCell As Range
    For Each rCell In Range(Range("F1"), Range("F1").SpecialCells(xlLastCell))
    rCell.Value = rCell.Value
    Next
    End Sub
    Note that this only works on the populated cells starting at row 1.

    To do the whole column, replace

    Range(Range("F1"), Range("F1").SpecialCells(xlLastCell))
    with

    Range("F:F")
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copy, Paste Special Values

    Try
    Dim rng As Range
    Set rng = Range(Cells(1, 6), Cells(Rows.Count, 6).End(xlUp))
    rng.Value = rng.Value
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1