Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Paste Column Width Language

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Paste Column Width Language

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Paste Column Width Language

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
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




  #5   Report Post  
Posted to microsoft.public.excel.programming
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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Paste Column Width Language

Holy cow, it works! Thanks a lot.

"Ron de Bruin" wrote:

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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Cell Width WITHOUT changing Column width dww701 Excel Discussion (Misc queries) 1 January 12th 09 10:52 PM
How to make cell width different than the column width it lies in John Excel Discussion (Misc queries) 2 September 11th 06 10:41 PM
Set Column Width Based On Total Width Of Other Columns rayneraingoaway Excel Programming 1 June 28th 06 11:10 PM
copy paste (column width prb) Murat D. Hekimošlu Excel Programming 2 May 12th 05 03:31 PM


All times are GMT +1. The time now is 09:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"