Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
A macro to copy & paste many rows (a range) to the next column .. | New Users to Excel | |||
macro to copy and paste | Excel Discussion (Misc queries) | |||
Should I use a macro to copy and paste value? | Excel Worksheet Functions | |||
Macro to Copy/Paste then Paste to Next Line | Excel Programming | |||
Copy Column and Paste | Excel Programming |