View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.hobin@jus.gov.on.ca is offline
external usenet poster
 
Posts: 8
Default Paste Column Width Language

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