Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Copy/Paste Macro and Column Sizing

Hi,
I've written a simple macro that copy/pastes a specific range from a source
worksheet to a new worksheet. It copy/pastes as values and formats in order
to eliminate formulas and maintain the source formatting. However, I can't
get the column widths to copy over as well. I can't just copy/paste the
whole column becuse the source range can be variable, and it's not the whole
column (there's data below that I don't want to copy/paste). How do I
copy/paste the column widths of a user defined cell range? The user is
defining the cell range by highlighting the range and then running the macro.
Any help would be greatly appreciated. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Copy/Paste Macro and Column Sizing

Hi
try reading the columnwidth property of the selected range and set this
width for the target location within your macro

--
Regards
Frank Kabel
Frankfurt, Germany

"JimK" schrieb im Newsbeitrag
...
Hi,
I've written a simple macro that copy/pastes a specific range from a

source
worksheet to a new worksheet. It copy/pastes as values and formats

in order
to eliminate formulas and maintain the source formatting. However, I

can't
get the column widths to copy over as well. I can't just copy/paste

the
whole column becuse the source range can be variable, and it's not

the whole
column (there's data below that I don't want to copy/paste). How do I
copy/paste the column widths of a user defined cell range? The user

is
defining the cell range by highlighting the range and then running

the macro.
Any help would be greatly appreciated. Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy/Paste Macro and Column Sizing

Range("DestinationRange").PasteSpecial 8

if you have excel 2000 or later.

--
Regards,
Tom Ogilvy

"JimK" wrote in message
...
Hi,
I've written a simple macro that copy/pastes a specific range from a

source
worksheet to a new worksheet. It copy/pastes as values and formats in

order
to eliminate formulas and maintain the source formatting. However, I

can't
get the column widths to copy over as well. I can't just copy/paste the
whole column becuse the source range can be variable, and it's not the

whole
column (there's data below that I don't want to copy/paste). How do I
copy/paste the column widths of a user defined cell range? The user is
defining the cell range by highlighting the range and then running the

macro.
Any help would be greatly appreciated. Thanks.



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
A macro to copy & paste many rows (a range) to the next column .. genehunter New Users to Excel 11 April 21st 09 07:36 AM
macro to copy and paste LALA Excel Discussion (Misc queries) 1 May 16th 08 04:46 AM
Should I use a macro to copy and paste value? Rebecca Excel Worksheet Functions 0 April 6th 06 10:03 PM
Macro to Copy/Paste then Paste to Next Line tomkarakowski Excel Programming 1 May 28th 04 01:19 AM
Copy Column and Paste steveh[_3_] Excel Programming 2 February 2nd 04 01:36 PM


All times are GMT +1. The time now is 10:41 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"