View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Userforms and autofilters - Autofilters don't seen to work with userform

I would like to have my userform display only what rows are filtered at a
given time. I would like to be able to use autofilter from normal excel
screen, and then use my userform. I would also like to be able to record one
of the autofilters and assign it to a button on my userform.

Currently, when I step through the rows with the up/down buttons on my form,
it shows each and every row.
Right now, I have 2 fields being displayed First and lastname, and then my
up/down SpinButton (and some other buttons for printing, closing ans
saving....)


What am I doing wrong?



I have the following code:

---------------------------------------
'module1

Sub GetGoing_CI()
If ActiveCell.Row = 1 Then ActiveCell.Offset(1, 0).Select
Dim jump As Variant
jump = 1 - ActiveCell.Column
ActiveCell.Offset(0, jump).Select
ActiveSheet.Range("A1").Select 'so that current region in init works
UserForm1.Show
End Sub


Sub FillMyForm1()
ContactFilterFlag = False
With UserForm1
'Assignment Col Ofs Item
' .textbox0 =ActiveCell.Offset(0, 0) ' A 0 Record_Number
..TextBox1 = ActiveCell.Offset(0, 1) ' B 1 First
..TextBox2 = ActiveCell.Offset(0, 2) ' C 2 LastName
End With

End Sub

---------------------------------------------

'Userform1

Private Sub UserForm_Initialize()
Worksheets("Contacts").Select
ws = "Contacts"
FillMyForm1
End Sub

Private Sub CommandButton1_Click()
Dim Mldg, stil, Titel, Antwort
Mldg = "Don't you want to save the database now ?"
stil = vbYesNo + vbCritical + vbDefaultButton2
Titel = "Exit Form"
Antwort = MsgBox(Mldg, stil, Titel)
If Antwort = vbYes Then
ActiveWorkbook.Save
Else
End If
Unload UserForm1
End Sub

Private Sub CommandButton2_Click()
UserForm1.PrintForm
End Sub

Private Sub CommandButton3_Click()
ActiveWorkbook.Save
End Sub

Private Sub SpinButton1_SpinDown()
ActiveCell.Offset(1, 0).Select
FillMyForm1
End Sub

Private Sub SpinButton1_SpinUp()
ActiveCell.Offset(-1, 0).Select
FillMyForm1
End Sub

Sub