Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Command button to search column

I have not coded in Excel before but have done some in
Access. I recently received a request to do the following:

In an Excel 2000 spreadsheet, I would like to be able to
press a command button, bring up a textbox that asks the
user for part of a search string for column "B" (can it
use wildcards?), and finally, go to the row where the
searched value exists.

TIA,
Al
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Command button to search column

Al,


Sub Find_in_column_B()
Dim FindString As String

FindString = InputBox("Enter string to find, use '?' and '*' as
appropriate", "Find what in column B")
Columns("B:B").Select
Selection.Find(What:=FindString, After:=ActiveCell, LookIn:=xlFormulas,
_
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
End Sub

Then Assign it to a button on a user toolbar (open Excel help in the Answer
Wizard and enter "assign a macro to a button")

Steve
"Al" wrote in message
...
I have not coded in Excel before but have done some in
Access. I recently received a request to do the following:

In an Excel 2000 spreadsheet, I would like to be able to
press a command button, bring up a textbox that asks the
user for part of a search string for column "B" (can it
use wildcards?), and finally, go to the row where the
searched value exists.

TIA,
Al



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Command button to search column

The built in Find command does this

you can display that dialog with

Private Sub CommandButton1_Click()
Columns(2).Select
application.Dialogs(xlDialogFormulaFind).Show
End Sub

or just use the shortcut key Ctrl+F

Yes, you can use wildcards.

If it finds the target, it will select the cell.
--
Regards,
Tom Ogilvy

"Al" wrote in message
...
I have not coded in Excel before but have done some in
Access. I recently received a request to do the following:

In an Excel 2000 spreadsheet, I would like to be able to
press a command button, bring up a textbox that asks the
user for part of a search string for column "B" (can it
use wildcards?), and finally, go to the row where the
searched value exists.

TIA,
Al



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
Command Button WLMPilot Excel Discussion (Misc queries) 1 May 8th 10 04:52 AM
command button add another command Wanna Learn Excel Discussion (Misc queries) 5 December 7th 08 11:42 PM
command button big show Excel Worksheet Functions 1 January 29th 07 02:38 PM
command button Hellboy Excel Discussion (Misc queries) 0 November 3rd 05 02:51 PM
Command Button vs Form Button T K Excel Programming 4 August 26th 03 07:26 PM


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