Excel 2003 vs 2000: PasteSpecial

M

marcevan

Macro in 2003 has this snippet which errors (1004) in Excel 2000:

Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False

Macro recorded in Excel 2000 has this:

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False

Excel 2000 version seems to work OK in 2000 and 2003...2003 only works
in 2003 (not in 2000).

Guessing "xlPasteValuesandNumberFormats" is not 2000 legal.

Just worries about some of the issues I'm reading about with Excel 2000
macros and use of PasteSpecial needed some kind of columnwidth setting
hard coded.
 
R

Ron de Bruin

Hi

Always build in the oldest version
Just worries about some of the issues I'm reading about with Excel 2000
macros and use of PasteSpecial needed some kind of columnwidth setting
hard coded.

For columnwidth you must use the 8

..Cells(1).PasteSpecial Paste:=8
' Paste:=8 will copy the column width in Excel 2000 and higher

also there is a bug with validation, use 6 then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top