Link to home
Start Free TrialLog in
Avatar of kbay808
kbay808Flag for United States of America

asked on

How do I set the destionation for a vba code to cell A4.

I have a vba code that will paste just the text into a cell from the clipboard, but I need the destination to be A4.

Sub Paste_Unformatted()
    If Application.CutCopyMode = xlCopy Then
        ActiveCell.PasteSpecial Paste:=xlPasteValues
    Else
        ActiveSheet.PasteSpecial Format:="Text", _
                                 Link:=False, _
                                 DisplayAsIcon:=False
    End If
End Sub

Open in new window

Avatar of Rgonzo1971
Rgonzo1971

Hi,

pls try

Sub Paste_Unformatted()
    If Application.CutCopyMode = xlCopy Then
        Range("A4").PasteSpecial Paste:=xlPasteValues
    Else
        Range("A4").PasteSpecial Format:="Text", _
                                 Link:=False, _
                                 DisplayAsIcon:=False
    End If
End Sub

Open in new window

Regards
Avatar of kbay808

ASKER

I'm receiving an error.  Please see the attached screen shot.
Error-Screen-Shot.jpg
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kbay808

ASKER

That worked perfect!!!  Thank you very much.