Solved

Paste Special

Posted on 2011-09-19
7
1,365 Views
Last Modified: 2012-05-12
I would like to know how to use paste special values in to Excel. I have played around with
oSheet2.Range("B3").PasteSpecial = Value, but It does not work.  

Can you help ?

thank you
0
Comment
Question by:drezner7
  • 3
  • 2
  • 2
7 Comments
 
LVL 46

Expert Comment

by:Martin Liss
ID: 36562623
Record a macro while doing it and then edit the macro to see how it's done.
0
 

Author Comment

by:drezner7
ID: 36562699
i do not want a macro, my code in vbscript is pretty large and I need to add this piece to it...
0
 

Author Comment

by:drezner7
ID: 36563356
Is there anyone that can help?
0
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.

 
LVL 46

Expert Comment

by:Martin Liss
ID: 36563718
   Range("D113:F113").Select
    Selection.Copy
    Range("T97").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
0
 
LVL 52

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 36564305
Since this is VBS, you will need to do something like:

oSheet1.Select
oSheet1.Range("A1").Copy
oSheet2.Range("B3").PasteSpecial -4163

Open in new window

Where -4163 indicates values only.

Name       Value       Description
xlPasteAll       -4104       Everything will be pasted.
xlPasteAllExceptBorders       7       Everything except borders will be pasted.
xlPasteAllUsingSourceTheme       13       Everything will be pasted using the source theme.
xlPasteColumnWidths       8       Copied column width is pasted.
xlPasteComments       -4144       Comments are pasted.
xlPasteFormats       -4122       Copied source format is pasted.
xlPasteFormulas       -4123       Formulas are pasted.
xlPasteFormulasAndNumberFormats       11       Formulas and Number formats are pasted.
xlPasteValidation       6       Validations are pasted.
xlPasteValues       -4163       Values are pasted.
xlPasteValuesAndNumberFormats       12       Values and Number formats are pasted.
0
 

Author Closing Comment

by:drezner7
ID: 36566650
BillPrew, you Rock...  You are awesome your help has allowed me to learn a lot more about VBS and how to use it correctly.  Thank you so much
0
 
LVL 52

Expert Comment

by:Bill Prew
ID: 36566678
Glad that helped, and thanks so much for the kind works, and grade.

~bp
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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

867 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

15 Experts available now in Live!

Get 1:1 Help Now