Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming,microsoft.public.scripting.vbscript
|
|||
|
|||
![]()
I use the following code in vbs to copy and paste data from one Excel cell
to another: XLBook.Worksheets("Sheet1").Select XLBook.Worksheets("Sheet1").Range("A1").Copy XLBook.Worksheets("Sheet1").Range("B1").PasteSpeci al My code above does a regular paste, but I need to do a paste special that only pastes values and number formats. I've created a macro in Excel that does this and the vba code for it is: Range("A1").Select Selection.Copy Range("B1").Select Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False However, the vba code above does not work in vbs. It throws an Expceted Statement error at the first colon (:) in the PasteSpecial line. Does anyone know how I can do this in vbs? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
key shortcut for PasteSpecial-Values | Excel Discussion (Misc queries) | |||
PasteSpecial / Formats also pastes a random range name | Excel Discussion (Misc queries) | |||
Command Button for PasteSpecial - Values - Transpose | Excel Discussion (Misc queries) | |||
PasteSpecial Values | Excel Programming | |||
How do I make a button to PasteSpecial Values only. | Excel Programming |