Solved

Excel vba copy column cells of specific worksheets to another worksheet.

Posted on 2011-03-15
5
725 Views
Last Modified: 2012-05-11
Hi! I have a workbook that contains several worksheets: Data, 2850 Open, 2850 Resolved (etc), and Trace. What I need is to copy the numbers in Colimns M and N in the "#### Open" worksheets to columns A & B on my "Trace" worksheet. I'd like to trigger the macro with the button I have installed on the Trace worksheet.Thanks for any help.... Stale-Events-Experts-Exchange-ex.xlsm
0
Comment
Question by:McQMom
  • 2
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 35140636
Here is the code and the file

Sub transfer()
Dim sht As Worksheet

Application.ScreenUpdating = False

Intersect(Sheets("TRACE").UsedRange, Sheets("TRACE").Range("A2:B" & Rows.Count)).ClearContents

For Each sht In ActiveWorkbook.Worksheets
    If Right(sht.Name, 4) = "Open" Then _
        sht.Range(sht.Cells(2, "M"), sht.Cells(Rows.Count, "N").End(xlUp)).Copy _
            Sheets("TRACE").Cells(Rows.Count, 1).End(xlUp).Offset(1)
Next sht

Application.ScreenUpdating = True
End Sub

Open in new window


Thomas
Copy-of-Stale-Events-Experts-Exc.xlsm
0
 

Author Closing Comment

by:McQMom
ID: 35140669
Perfect! thank you so much for the quick response....
0
 
LVL 39

Expert Comment

by:nutsch
ID: 35140702
Glad to help. Thanks for the grade.

Thomas
0
 
LVL 29

Expert Comment

by:gowflow
ID: 35140951
Hello,
Is this what your looking for ?
gowflow
Stale-Events-Experts-Exchange-ex.xlsm
0
 
LVL 29

Expert Comment

by:gowflow
ID: 35140961
OOPs I guess I was a bitttttt late !!!
Cheers
gowflow
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
My experience with Windows 10 over a one year period and suggestions for smooth operation
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question