#1   Report Post  
Posted to microsoft.public.excel.programming
TOM TOM is offline
external usenet poster
 
Posts: 4
Default Copy

Hello,

I have a one litlle problem. I wnat copy some range for ex. A1:I22 to
another sheet. I need copy evrything (data,format...), but excel copy all
except width row.
Is there some way how can I copy evrythnig? In VB of course.

Thanks for your advice
TOM


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default Copy

Rows don't have width, columns do. If you copy/paste entire columns,
the width will also be transrerred. Otherwise you will have to manually
adjust the destination width.

Jerry

TOM wrote:

Hello,

I have a one litlle problem. I wnat copy some range for ex. A1:I22 to
another sheet. I need copy evrything (data,format...), but excel copy all
except width row.
Is there some way how can I copy evrythnig? In VB of course.

Thanks for your advice
TOM


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Copy

Hi Tom,

Sub CopyAll()
Dim sourceRng As Range, destRng As Range
Dim i As Long
Dim ws1 As Worksheet, ws2 As Worksheet

Set ws1 = ActiveWorkbook.Worksheets("Sheet1") '<<<< CHANGE
Set ws2 = ActiveWorkbook.Worksheets("Sheet2") '<<<< CHANGE

Set sourceRng = ws1.Range("A1:I22") '<<<< CHANGE
Set destRng = ws2.Range("D5") '<<<< CHANGE

sourceRng.Copy
With destRng
..PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
..PasteSpecial Paste:=8 ' Column widths

For i = 1 To sourceRng.Rows.Count
..Rows(i).RowHeight = sourceRng.Rows(i).RowHeight
Next i
End With

End Sub

---
Regards,
Norman



"TOM" wrote in message
...
Hello,

I have a one litlle problem. I wnat copy some range for ex. A1:I22 to
another sheet. I need copy evrything (data,format...), but excel copy all
except width row.
Is there some way how can I copy evrythnig? In VB of course.

Thanks for your advice
TOM




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
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM
How copy format, font, color and border without copy/paste? Michel[_3_] Excel Programming 1 November 5th 03 04:43 PM


All times are GMT +1. The time now is 03:47 AM.

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

About Us

"It's about Microsoft Excel"