Solved

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

Posted on 2014-12-02
4
86 Views
Last Modified: 2014-12-02
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

0
Comment
Question by:kbay808
  • 2
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40475364
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
0
 

Author Comment

by:kbay808
ID: 40475378
I'm receiving an error.  Please see the attached screen shot.
Error-Screen-Shot.jpg
0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40475399
pls try

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

Open in new window

0
 

Author Closing Comment

by:kbay808
ID: 40475401
That worked perfect!!!  Thank you very much.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

929 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

11 Experts available now in Live!

Get 1:1 Help Now