Thread: pause a macro
View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default pause a macro

glad to help
regards
FSt1

"tsmith" wrote:

Thank you! That worked perfectly!

Always looking forward to learning something new in Excel!

"FSt1" wrote:

hi
sorry it took so long to get back. got hung up.
looks like you are doing this more than once which might suggest a loop but
with out seeing our code, i would be afraid to suggest that soo....
here is the line you single out...
*here is where i need to pause to manually select the month
Selection.AutoFilter Field:=3, Criteria1:="=ATL", Operator:=xlOr, _
Criteria2:="=OTR"
it looks like you need 2 criterias so
dim c as string
dim oc as string
c=Inputbox("enter the criteria")
oc = Inputbox("enter the other cirteria")

Selection.AutoFilter Field:=3, Criteria1:=c, Operator:=xlOr, _
Criteria2:=oc

this is how an inputbox work. you create variables, assign values to the
variables then plug the variable into the code as i did above for criteria.
the macro will pause, display the input box and wait for criteria to be
entered.

regards
FSt1

"tsmith" wrote:

2003

this macro is huge since i print to 18 diff printers so i shortened it for
example purposes

Application.Run "'PM DUE REPORT.xls'!refresh"
Selection.AutoFilter Field:=7, Criteria1:="=95%", Operator:=xlAnd
Selection.AutoFilter Field:=9, Criteria1:="000-002"
Selection.AutoFilter Field:=3, Criteria1:="ATL"
Application.ActivePrinter = "02Atlanta LaserJet 2100 on Ne18:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"02Atlanta LaserJet 2100 on Ne17:", Collate:=True
Selection.AutoFilter Field:=9, Criteria1:="000-055"
*here is where i need to pause to manually select the month
Selection.AutoFilter Field:=3, Criteria1:="=ATL", Operator:=xlOr, _
Criteria2:="=OTR"
Application.ActivePrinter = "02Atlanta LaserJet 2100 on Ne18:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"02Atlanta LaserJet 2100 on Ne17:", Collate:=True

Thanks!

"FSt1" wrote:

hi
what version xl are you using?
post the code your are using now.

regards
FSt1

"tsmith" wrote:

Yeah I guess the question was a little vague, here is my issue

I have autofilter applied to one of my rows, my macro is set up to pick
"000-002" from one of the filters then print the results. After that I need
it to pick "000-055" then go to another filter and pause so I can select the
month (1-12) before printing those results.

So basicaly I need a pause to be able to select an autofilter field.

Thanks

"FSt1" wrote:

hi
the info you supplied is vague so about all i can give is a vague answer.
yes. use an input box.
see vb help on input boxes.

regards
FSt1

"tsmith" wrote:

I know you can pause a macro to enter data into a cell but I need to pause a
macro to change a filter selection. Is there a way to do this?

Thanks in advance for any suggestions.