View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Paste Column Width Language

Excel 2000 ?

There is a bug in the version

I always use the numner 8

PasteSpecial 8

Working in all Excel versions

Same problem for validation as far as I know (use 6 for that)

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


" wrote in message
...
SteveC, did you ever get a good answer to your question? I've been hunting
for an answer to this myself. I found that if you record a macro where you
cut and PasteSpecial the column widths, the CODE GENERATED BY EXCEL generates
a "Variable not defined" error referring to xlColumnWidths when I try to run
it again! How can code generated by Excel's own macro recorder, contain
errors? It's baffling!

"SteveC" wrote:

ah, thanks

"Mike Fogleman" wrote:

It seems to be xlPasteColumnWidths.

Mike F
"SteveC" wrote in message
...
This does not work:

Workbooks("Hot List.xls").Sheets("Snapshot").Cells.Copy
ThisWorkbook.Sheets(ShName).Range("A1").PasteSpeci al xlColumnWidths

But this does:
Workbooks("Hot List.xls").Sheets("Snapshot").Cells.Copy
ThisWorkbook.Sheets(ShName).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

is the command in the first code excerpt not xlColumnWidths?

thanks...

Steve