kiraexiled
New Member
- Joined
- Sep 1, 2012
- Messages
- 3
Hi everyone, I'm working on a macro that loops through a column of values and prints pdfs based on those variables.
I have managed to get everything working fine except for the order of the print.
Below is my macro:
I have values from E21 to E30. The macro would first print a pdf based on the value in E21 and right after that starts printing based on values from E30 then E29, E28,E27 and so on. What have I done wrong to make the macro loop in a reverse order?
Also the application wait function doesnt seem to be working either. Would appreciate help on that too.
Thanks a bunch!
Sam.
I have managed to get everything working fine except for the order of the print.
Below is my macro:
Code:
Sub DocPrint()
Worksheets("Main").Activate
Application.ScreenUpdating = False
ActiveCell.CurrentRegion.Select
On Error Resume Next
For Each a In Range("E21")
If a.Value = "" Then Exit Sub
File = "*" & a.Value & "*"
fNAME = fPATH & "*" & File & "*" & ".pdf"
Shell "C:\LOCALAPP\Apps\AcrobatReader\Reader\AcroRd32.exe /p /h " & fNAME
Application.Wait Now + TimeValue("00:00:10")
Next a
End Sub
I have values from E21 to E30. The macro would first print a pdf based on the value in E21 and right after that starts printing based on values from E30 then E29, E28,E27 and so on. What have I done wrong to make the macro loop in a reverse order?
Also the application wait function doesnt seem to be working either. Would appreciate help on that too.
Thanks a bunch!
Sam.