Thread: Cancel/Exit Sub
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Howard Howard is offline
external usenet poster
 
Posts: 40
Default Cancel/Exit Sub

This code works but, how can I exit this code if I hit "Cancel" or "OK?"
Field (column) 7 has either a yes or a no in the cell.

With ActiveSheet
.UsedRange.AutoFilter Field:=7, Criteria1:=InputBox(prompt:="Enter
Yes or No")
.PageSetup.Orientation = xlLandscape
.PrintOut
.UsedRange.AutoFilter
End With
Range("A1").Select

Thanks,
--
Howard