Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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








  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userforms and autofilters - Autofilters don't seen to work with userform

It doesn't make any difference to Vba if your cells are hidden. You have to
check the cells to see if they are hidden and have your code ignore those
cells.

--
Regards,
Tom Ogilvy

wrote in message
news:MNo3b.284371$Ho3.39036@sccrnsc03...
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










  #3   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

so basically when I do my spindown it should be something like this:


Private Sub SpinButton1_SpinDown()
ActiveCell.Offset(1, 0).Select
do While Selection.rows.Hidden = True
ActiveCell.Offset(1, 0).Select
Loop
FillMyForm1
End Sub




"Tom Ogilvy" wrote in message
...
It doesn't make any difference to Vba if your cells are hidden. You have

to
check the cells to see if they are hidden and have your code ignore those
cells.

--
Regards,
Tom Ogilvy

wrote in message
news:MNo3b.284371$Ho3.39036@sccrnsc03...
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












  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userforms and autofilters - Autofilters don't seen to work with userform

That should work.

--
Regards,
Tom Ogilvy

wrote in message
news:CWp3b.284931$Ho3.39214@sccrnsc03...
so basically when I do my spindown it should be something like this:


Private Sub SpinButton1_SpinDown()
ActiveCell.Offset(1, 0).Select
do While Selection.rows.Hidden = True
ActiveCell.Offset(1, 0).Select
Loop
FillMyForm1
End Sub




"Tom Ogilvy" wrote in message
...
It doesn't make any difference to Vba if your cells are hidden. You

have
to
check the cells to see if they are hidden and have your code ignore

those
cells.

--
Regards,
Tom Ogilvy

wrote in message
news:MNo3b.284371$Ho3.39036@sccrnsc03...
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














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
AutoFilters Joli Excel Worksheet Functions 1 March 21st 06 09:14 PM
Freezing Autofilters Elcoholic Excel Worksheet Functions 0 September 23rd 05 06:38 AM
How to set up AutoFilters? MS Suzanne Excel Worksheet Functions 1 June 30th 05 03:53 AM
autofilters Diego Villaseñor Fernández Excel Worksheet Functions 0 January 13th 05 11:27 PM
Help with Userforms and filters or autofilters Bruccce Excel Programming 0 July 31st 03 04:37 PM


All times are GMT +1. The time now is 11:20 PM.

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"