Bob Barnes
asked on
How can this Excel macro be more efficient and more versatile?
I have attached abridged detals of an Excel macro, which each week has to be renamed to work with the current week and enlarged to include an additional line of activity. Although this sort of works, it's cumbersome and I would like it to be more efficient and versatile. I have included details of Week 03, Week 04 and Week 05 so you can see the week by week progression as the macro grows; by the end of the year I will have 52 separate macros. Just one macro to do the whole job would be great. Thanks for any help available.
Bob
Bob
attachment missing?
ASKER
Sorry.
Analysis-Macro.txt
Analysis-Macro.txt
Here's a slightly more concise version of your first subroutine; you could easily adapt this code to your other two:
Regards,
-Glenn
Sub Prepare_Week_03()
Dim r As Integer
Selection.Copy
Windows("Week_03.xlsx").Activate
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
For r = 5 To 7
If Cells(r, 2) <> 0 Then GoTo Fin
Cells(r, 2).EntireRow.Hidden = True
Next r
Fin:
Range("A2").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
Regards,
-Glenn
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.