Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Copy column A and column D from all sheets into new worksheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
al007 - 21 Jan 2006 07:42 GMT
How can I copy column A and column D from all sheets to a new sheet
while offsetting the paste ie the 2  column being pasted next to the
other

thxs

posting again as i've got an unclear answer from an ...
Toppers - 21 Jan 2006 10:49 GMT
Hi,
         I assume Sheet1 columns A and D are copied to A,B on "newsheet"
and A and D from other sheets are copied to columns C,D/E,F  etc as your
request indicates you want to copy columns in total to a single new sheet.

Sub CopyAandD()

   Dim oRng As Range
   Dim newsh As Worksheet
   
   Set newsh = Worksheets("Sheet3")  ' <==== Change to your "new sheet"
   Set oRng = newsh.Range("A:A")     '  <===== Copy to column A
   
   For Each Sh In ActiveWorkbook.Worksheets
       If Sh.Name <> newsh.Name Then
           Sh.Range("A:A,D:D").Copy oRng
           Set oRng = oRng.Offset(0, 2)
       End If
   Next
   
End Sub

> How can I copy column A and column D from all sheets to a new sheet
> while offsetting the paste ie the 2  column being pasted next to the
[quoted text clipped - 3 lines]
>
> posting again as i've got an unclear answer from an ...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.