View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bruccce Bruccce is offline
external usenet poster
 
Posts: 20
Default Repost: Looking for info on how to program a userform to use filters

What you mean by filter is not very clear. Are you trying to filter
information shown in a listbox on the form or use the form to get setttings
for an autofilter (as an example) on a worksheet?
What I want to do, is to look at only certain sets of information while I am
using my form.

Example:
I am calling people, nationwide. I might want to set it where I am only
seeing people in MY timezone, that I have not talked to yet.

Columns that I would create an autofilter on would be timezone and call
results
Here is a filter that works while in the spreadsheet:
Sub TimeZoneVoiceDrop()
'
' TimeZoneVoiceDrop Macro
' Macro recorded 8/5/2003 by Bruce
'

'
Selection.AutoFilter
ActiveWindow.ScrollColumn = 61
ActiveWindow.ScrollColumn = 56
ActiveWindow.ScrollColumn = 54
ActiveWindow.ScrollColumn = 53
ActiveWindow.ScrollColumn = 51
ActiveWindow.ScrollColumn = 50
ActiveWindow.ScrollColumn = 48
ActiveWindow.ScrollColumn = 47
ActiveWindow.ScrollColumn = 46
ActiveWindow.ScrollColumn = 45
ActiveWindow.ScrollColumn = 44
ActiveWindow.ScrollColumn = 43
ActiveWindow.ScrollColumn = 42
ActiveWindow.ScrollColumn = 41
ActiveWindow.ScrollColumn = 39
ActiveWindow.ScrollColumn = 38
ActiveWindow.ScrollColumn = 36
ActiveWindow.ScrollColumn = 35
ActiveWindow.ScrollColumn = 32
ActiveWindow.ScrollColumn = 31
ActiveWindow.ScrollColumn = 29
ActiveWindow.ScrollColumn = 28
ActiveWindow.ScrollColumn = 27
ActiveWindow.ScrollColumn = 25
ActiveWindow.ScrollColumn = 24
ActiveWindow.ScrollColumn = 23
ActiveWindow.ScrollColumn = 22
ActiveWindow.ScrollColumn = 21
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
Selection.AutoFilter Field:=7, Criteria1:="0"
Selection.AutoFilter Field:=10, Criteria1:="Voice Drop"
End Sub

And it only shows 13 records with my current data set.
However, when I launch my userform, it show ALL records. It does not pay
attention to any filters I have in place. I have tried to assign the
filtermacro to a user button, but that did not help either....

I hope this is clearer than mud...

Bruce



"Tom Ogilvy" wrote in message
...
http://www.microsoft.com/ExcelDev/Articles/sxs11pt1.htm
Lesson 11: Creating a Custom Form
Excerpted from Microsoft® Excel 97 Visual Basic® Step by Step.

http://support.microsoft.com/default.aspx?kbid=161514
XL97: How to Use a UserForm for Entering Data

http://support.microsoft.com/default.aspx?kbid=213749
XL2000: How to Use a UserForm for Entering Data


What you mean by filter is not very clear. Are you trying to filter
information shown in a listbox on the form or use the form to get

setttings
for an autofilter (as an example) on a worksheet?

Regards,
Tom Ogilvy



"Bruccce" wrote in message
news:uJRXa.72449$YN5.55027@sccrnsc01...
I am trying to create a userform that I can set filters in. I am looking

for
how to do this.

I have tried creating a macro that sets the filter I want, and put it in

the
userform, and assigned this to a button, but userform does not seem to
recognize the filter. It still shows every record. What am I doing wrong

Where can I find this info? (I have several books, but I can not find

this
combination covered....)

I have had somebody create a userform for me, but I need to change the
filter, and I need to change a lot of other items about the form, so I

want
to basically start from scratch.

I would like to LEARN how to do this so I can maintain my own code.

thanks
Bruce