Results 1 to 7 of 7

Thread: [RESOLVED] Pastespecial xlPasteValues same column

  1. #1

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Resolved [RESOLVED] Pastespecial xlPasteValues same column

    Hi there,

    Column I has formulas (=G1+H1) which need to become values. What I was thinking was to simply copy the column and use pastespecial to paste it again.

    Code:
    Columns("I").Copy
    Columns("I").PasteSpecial Paste:=xlPasteValues
    Nothing seems to happen.
    What am, I doing wrong here? Thanks in advance.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: Pastespecial xlPasteValues same column

    Try this:

    Code:
    Sub psvals()
        Range("i1").EntireColumn.Copy
        Range("i1").PasteSpecial xlPasteValues
    End Sub

  3. #3

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Pastespecial xlPasteValues same column

    Seems something is going absolutely wrong.

    This is my code to add the Formula and then copy/paste it as Value

    Code:
        With Range("I2")
            .FormulaR1C1 = "=RC[-2]+RC[-1]"
            '.AutoFill Destination:=Range(.Offset(0, -1), .Offset(0, -1).End(xlDown)).Offset(0, 1)
            .AutoFill .Resize(.Offset(Rows.Count - .Row, -1).End(xlUp).Row)
        End With
        
        Range("I1").EntireColumn.Copy
        Range("I1").PasteSpecial xlPasteValues
    The complete "usedrange" of column-I get's the value of I1.
    Means when !i have the sum of 100, every cell in the "usedrange" of column-I get's the value of 100. Hope I said that right.

    What could be the issue?


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  4. #4
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: Pastespecial xlPasteValues same column

    I'm not following. Can you zip and attach your example?

  5. #5

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Pastespecial xlPasteValues same column

    It has sensitive information, but I can mail it to you of you'd send me you e-mail via PM.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  6. #6
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Pastespecial xlPasteValues same column

    1. Are macros enabled?
    2. If macros are enabled then you need to fully qualify the sheet names... See this code

    Code:
    Sub Sample()
        Dim ws As Worksheet
        
        Set ws = ThisWorkbook.Sheets("Sheet1")
        
        With ws
            .Columns(9).Copy
            .Columns(9).PasteSpecial Paste:=xlPasteValues
            Application.CutCopyMode = False
        End With
    End Sub
    OR

    Code:
    Sub Sample()
        Dim ws As Worksheet
        
        Set ws = ThisWorkbook.Sheets("Sheet1")
        
        With ws
            .Range("I:I").Value = .Range("I:I").Value
        End With
    End Sub
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  7. #7

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Pastespecial xlPasteValues same column

    Completely EDIT POST

    The result is the issue again

    Talk to you tomorrow.
    Last edited by Radjesh Klauke; Nov 10th, 2012 at 01:52 PM.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

Posting Permissions

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



Click Here to Expand Forum to Full Width