Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Printing help

I have a userform named RPTFRM w/ a text box named rptDte and a Commad
button named cb1 this is what i have so far...

Private Sub cb1_Click()
Selection.AutoFilter Field:=5, Criteria1:=rptDte.Value
VBAProject.ThisWorkbook.PrintPreview
Selection.AutoFilter
Unload Me
End Sub

Private Sub UserForm_Initialize()
Range("Headers").Select
Selection.AutoFilter
End Sub

When i step through the code it does what i want but locks up after print
preview.
I am trying to get only the information printed defined in the criteria text
box. any help would be great.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Printing help

Couldn't duplicate the problem. Just curious about why you have the second
AutoFilter command just what looks like unloading the user form.

"Office_Novice" wrote:

I have a userform named RPTFRM w/ a text box named rptDte and a Commad
button named cb1 this is what i have so far...

Private Sub cb1_Click()
Selection.AutoFilter Field:=5, Criteria1:=rptDte.Value
VBAProject.ThisWorkbook.PrintPreview
Selection.AutoFilter
Unload Me
End Sub

Private Sub UserForm_Initialize()
Range("Headers").Select
Selection.AutoFilter
End Sub

When i step through the code it does what i want but locks up after print
preview.
I am trying to get only the information printed defined in the criteria text
box. any help would be great.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Printing help

The second AutoFilter is to Undo the filter. I only need to create a report.
Thanks for looking though. it really worked for you, huh?

"JLGWhiz" wrote:

Couldn't duplicate the problem. Just curious about why you have the second
AutoFilter command just what looks like unloading the user form.

"Office_Novice" wrote:

I have a userform named RPTFRM w/ a text box named rptDte and a Commad
button named cb1 this is what i have so far...

Private Sub cb1_Click()
Selection.AutoFilter Field:=5, Criteria1:=rptDte.Value
VBAProject.ThisWorkbook.PrintPreview
Selection.AutoFilter
Unload Me
End Sub

Private Sub UserForm_Initialize()
Range("Headers").Select
Selection.AutoFilter
End Sub

When i step through the code it does what i want but locks up after print
preview.
I am trying to get only the information printed defined in the criteria text
box. any help would be great.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Printing help

Yes, it stepped through the print preview to the AutoFilter toggle command.
I would have used AutoFilterMode = False to turn it off, but that's just me.
I substituted a cell value for the textbox value, but it shouldn't make any
difference as long as you have a value in the textbox for it to capture, it
should filter on it. You might want to slip a message box in there or do a
debug.print to check that text box value. Here is an example of how to check
it.

Private Sub cb1_Click()
MsgBox rpt.Dte.Value
Selection.AutoFilter Field:=5, Criteria1:=rptDte.Value

The message box will show what the actual text box value is, if any, before
the filter is activated.


"Office_Novice" wrote:

The second AutoFilter is to Undo the filter. I only need to create a report.
Thanks for looking though. it really worked for you, huh?

"JLGWhiz" wrote:

Couldn't duplicate the problem. Just curious about why you have the second
AutoFilter command just what looks like unloading the user form.

"Office_Novice" wrote:

I have a userform named RPTFRM w/ a text box named rptDte and a Commad
button named cb1 this is what i have so far...

Private Sub cb1_Click()
Selection.AutoFilter Field:=5, Criteria1:=rptDte.Value
VBAProject.ThisWorkbook.PrintPreview
Selection.AutoFilter
Unload Me
End Sub

Private Sub UserForm_Initialize()
Range("Headers").Select
Selection.AutoFilter
End Sub

When i step through the code it does what i want but locks up after print
preview.
I am trying to get only the information printed defined in the criteria text
box. any help would be great.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Printing help

I will give it a shot and let you know.

"JLGWhiz" wrote:

Yes, it stepped through the print preview to the AutoFilter toggle command.
I would have used AutoFilterMode = False to turn it off, but that's just me.
I substituted a cell value for the textbox value, but it shouldn't make any
difference as long as you have a value in the textbox for it to capture, it
should filter on it. You might want to slip a message box in there or do a
debug.print to check that text box value. Here is an example of how to check
it.

Private Sub cb1_Click()
MsgBox rpt.Dte.Value
Selection.AutoFilter Field:=5, Criteria1:=rptDte.Value

The message box will show what the actual text box value is, if any, before
the filter is activated.


"Office_Novice" wrote:

The second AutoFilter is to Undo the filter. I only need to create a report.
Thanks for looking though. it really worked for you, huh?

"JLGWhiz" wrote:

Couldn't duplicate the problem. Just curious about why you have the second
AutoFilter command just what looks like unloading the user form.

"Office_Novice" wrote:

I have a userform named RPTFRM w/ a text box named rptDte and a Commad
button named cb1 this is what i have so far...

Private Sub cb1_Click()
Selection.AutoFilter Field:=5, Criteria1:=rptDte.Value
VBAProject.ThisWorkbook.PrintPreview
Selection.AutoFilter
Unload Me
End Sub

Private Sub UserForm_Initialize()
Range("Headers").Select
Selection.AutoFilter
End Sub

When i step through the code it does what i want but locks up after print
preview.
I am trying to get only the information printed defined in the criteria text
box. any help would be great.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 printing problem--printing 1 document on 2 pages Bons Excel Discussion (Misc queries) 0 December 24th 09 04:15 PM
Excel Printing --Borders are not printing on the same page as data Stup88 Excel Discussion (Misc queries) 1 August 7th 07 09:34 AM
Printing a heading on each new page when printing Brian Excel Discussion (Misc queries) 3 November 15th 06 05:22 PM
Enable Double sided printing contiuously when printing multiple s. Lee Excel Discussion (Misc queries) 1 November 27th 04 01:58 AM
Printing? Worksheets not printing the same on multiple pc's! 43fan Excel Programming 2 April 29th 04 02:34 PM


All times are GMT +1. The time now is 04:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"