Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Paste Special VBScript

Posted on 2011-09-16
4
Medium Priority
?
2,835 Views
Last Modified: 2012-05-12
I am trying to copy one column from the same sheet in excel to another column, but paste it as paste special only the values. I have tried this in my vbscript code, but it does not work

Selection.PasteSpecial Paste = xlPasteValues

Can you help

Here is the code:

Osheet2.Range("H3:H789").Select
oExcel.Selection.Copy
oSheet2.Range("A3").Select
Selection.PasteSpecial Paste = xlPasteValues
0
Comment
Question by:drezner7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
Bill Prew earned 2000 total points
ID: 36551009
0
 

Author Comment

by:drezner7
ID: 36551078
Thx
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 36551278
You have your answer but in case you're not aware when you want to find out how to do something in Excel you can record and then copy a macro. I just recoreded this one.


    Selection.Copy
    Range("C8").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

Open in new window

0
 
LVL 58

Expert Comment

by:Bill Prew
ID: 36551550
@MartinLiss

Yes, that's a great tool, but the problem in this case is that it will produce VBA code to accomplish the task, and that is not the same as a standalone VBS script.  Some of the VBA constructs and operators are not available in VBS.  That's why we have to use a different approach here.

~bp
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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