Solved

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

Posted on 2014-12-02
4
81 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 48

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 48

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
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 view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

705 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

17 Experts available now in Live!

Get 1:1 Help Now