troubleshooting Question

Excel VBA

Avatar of desmondwkng
desmondwkngFlag for Hong Kong asked on
Microsoft OfficeMicrosoft ExcelMicrosoft Applications
9 Comments2 Solutions360 ViewsLast Modified:
Hi experts,

I've an VBA to print out reports for for different catergories, but sometime there is nothing in the cat and therefore I don't need to print it out.
That is the "Blue" cell (G61) in the attached file, but the column "G" is definite but row "61" is a variable which depends on the number of entries of that date.
In short, if G61(or the Blue cell)=0, no need to print and go to next

Can you help me to modify my macro,

    Application.ScreenUpdating = False
    Selection.AutoFilter Field:=7, Criteria1:="Cash"
    ActiveWindow.SelectedSheets.Printout Copies:=1, Collate:=True
    Selection.AutoFilter Field:=7, Criteria1:="Cheque"
    ActiveWindow.SelectedSheets.Printout Copies:=1, Collate:=True
    Selection.AutoFilter Field:=7, Criteria1:="Credit Card"
    ActiveWindow.SelectedSheets.Printout Copies:=1, Collate:=True
    Selection.AutoFilter Field:=7, Criteria1:="Direct(HSBC)"
    ActiveWindow.SelectedSheets.Printout Copies:=1, Collate:=True
    Selection.AutoFilter Field:=7
    ActiveWorkbook.Save


Thanks

Desmond
Collection-Summary-1205--.xls
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros