LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default Want to get text entered in a Userform TextBox after hitting Tab o

This is probably so basic I'll shoot myself but I can't get this simple
command to work.

Basically,
I have an empty box that the user can type a string in.
I want to use the string to create an autofilter.
I have all the code to apply the filter, I just need to get the string from
the text box.

inpPNa is the text box and I've tried:
FilterVal = inpPNa.value, FilterVal = inpPNa.text
and both times: FilterVal = ""

I want to make this as easy as possible so I'd like to run the code whenever
someone types something in the box and presses Enter or Tab.

If I can get the string, I can add the wildcards to it as shown below.

Thanks,

MikeZz

Private Sub inpPro_Change()
Dim FilterVal As String

If Len(inpPNa) < 0 Then
FilterVal = "ClearThisFilter"
Else
FilterVal = "=*" & inpPNa.Text & "*"
End If


 
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
highlight text in userform textbox RB Smissaert Excel Programming 1 November 2nd 05 11:44 PM
Userform - Move to next textbox field by hitting enter instead of TimT Excel Programming 12 November 2nd 05 09:06 PM
hitting spacebar in excel deletes last character entered. badgercat New Users to Excel 0 March 14th 05 09:47 PM
Using The Text From A Textbox In A UserForm Donna[_7_] Excel Programming 2 February 24th 05 03:25 PM
formatting text in TextBox in UserForm Kevin Excel Programming 2 November 7th 03 01:34 PM


All times are GMT +1. The time now is 12:26 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"