LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Getvalues Macro Help Needed

How can I make the macro below work for multiple spreadsheets with the same
formats. For instance I have 4 spreadsheets:

2045875
2045876
2045877
2045878

All identical in with their headers, but with different data. I need the
following macro to pull from ALL of the spreadsheets.

Private Sub Worksheet_Activate()
Call Sheet4.getvalues
End Sub
Sub getvalues()
Application.ScreenUpdating = False
Application.EnableEvents = False
lr = Application.Max(2, Cells(Rows.Count, 1).End(xlUp).Row)
'MsgBox lr
Rows("2:" & lr).Delete
With Worksheets("June 13 - 2045875")
slr = .Cells(Rows.Count, "c").End(xlUp).Row
'MsgBox slr
For i = 6 To slr
dlr = Cells(Rows.Count, "a").End(xlUp).Row + 1
' If .Cells(i, "as") 0 Then .Rows(i).Copy Rows(dlr)
If .Cells(i, "as") 0 And Not IsDate(.Cells(i, "at")) Then .Rows(i).copy
Rows(dlr)
Next i
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Sub Fixit1() 'Use if event macro stops working
Application.EnableEvents = True
End Sub

Thanks in advance :)
 
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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
MACRO NEEDED AshMorK Excel Discussion (Misc queries) 7 November 27th 06 05:47 PM
Macro needed to set macro security in Excel to minimum Carl Excel Programming 3 March 18th 06 03:36 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 09:29 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"