D
D. Pirate Roberts
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").PasteSpecial
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?
to another:
XLBook.Worksheets("Sheet1").Select
XLBook.Worksheets("Sheet1").Range("A1").Copy
XLBook.Worksheets("Sheet1").Range("B1").PasteSpecial
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?