Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro question

Status
Not open for further replies.

msnook

Technical User
Jul 6, 2007
41
US
Is there a way (using a macro) to copy data from one workbook to another with out having to actually having to view the workbook on the screen. I am sure there is but do not remember how it is done. I am trying to speed up the process and stop the flashing screen. The below example works just with the flashing screen.

If ((Worksheets("Operator Activity Report").Range("C" & A)) = z) Then

Range("B" & A, "N" & A).Select
Selection.Copy
Windows("Book1.xls").Activate
Worksheets("Sheet1").Range("C" & (y)).Select
ActiveSheet.Paste
Windows("Part B.xls").Activate
Worksheets("Operator Activity Report").Activate
y = y + 1
End If
 





Hi,

Avoid ACTIVATE and SEECT methods
Code:
    With Worksheets("Operator Activity Report")

        If ((.Range("C" & a)) = z) Then
        
            .Range("B" & a, "N" & a).Copy
            Workbooks("Book1.xls").Worksheets("Sheet1").Range("C" & (y)).PasteSpecial xlPasteAll
            y = y + 1
        End If
        
    End With


Skip,

[glasses] When a wee mystic is on the loose..
It's a Small Medium at Large! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top