Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Placing a 'find'(ctrl+F) button in a UserForm

Alright, i'm trying to have a command button on my userform that, whe
pressed, will hide UserForm, bring up the the Find dialog box (ctrl+F)
and then, when i'm done with using find and close it, the UserForm wil
unhide and return...I know this seems a little difficult, but how coul
i accomplish this?

Thanks in advance mates :

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Placing a 'find'(ctrl+F) button in a UserForm

Have you looked at VBA Help?
============================
Find Method
See Also Applies To Example Specifics
Find method as it applies to the WorksheetFunction object.

Finds specific information in a worksheet.

expression.Find(Arg1, Arg2, Arg3)

expression Required. An expression that returns a WorksheetFunctio
object.

Arg1 Required String. The name of the worksheet.

Arg2 Required String. The name of the range.

Arg3 Optional Variant. The name of an argument to refine the search.

Find method as it applies to the Range object.

Finds specific information in a range, and returns a Range object tha
represents the first cell where that information is found. Return
Nothing if no match is found. Doesn’t affect the selection or th
active cell.

For information about using the Find worksheet function in Visua
Basic, see Using Worksheet Functions in Visual Basic.

expression.Find(What, After, LookIn, LookAt, SearchOrder
SearchDirection, MatchCase, MatchByte, SearchFormat)

expression Required. An expression that returns a Range object.

What Required Variant. The data to search for. Can be a string or an
Microsoft Excel data type.

After Optional Variant. The cell after which you want the search t
begin. This corresponds to the position of the active cell when
search is done from the user interface. Note that After must be
single cell in the range. Remember that the search begins after thi
cell; the specified cell isn’t searched until the method wraps bac
around to this cell. If you don’t specify this argument, the searc
starts after the cell in the upper-left corner of the range.

LookIn Optional Variant. The type of information.

LookAt Optional Variant. Can be one of the following XlLookA
constants: xlWhole or xlPart.

SearchOrder Optional Variant. Can be one of the followin
XlSearchOrder constants: xlByRows or xlByColumns.

SearchDirection Optional XlSearchDirection. The search direction.

XlSearchDirection can be one of these XlSearchDirection constants.
xlNext default
xlPrevious

MatchCase Optional Variant. True to make the search case sensitive
The default value is False.

MatchByte Optional Variant. Used only if you’ve selected or installe
double-byte language support. True to have double-byte characters matc
only double-byte characters. False to have double-byte characters matc
their single-byte equivalents.

SearchFormat Optional Variant. The search format.

Remarks
The settings for LookIn, LookAt, SearchOrder, and MatchByte are save
each time you use this method. If you don’t specify values for thes
arguments the next time you call the method, the saved values are used
Setting these arguments changes the settings in the Find dialog box
and changing the settings in the Find dialog box changes the save
values that are used if you omit the arguments. To avoid problems, se
these arguments explicitly each time you use this method.

You can use the FindNext and FindPrevious methods to repeat th
search.

When the search reaches the end of the specified search range, it wrap
around to the beginning of the range. To stop a search when thi
wraparound occurs, save the address of the first found cell, and the
test each successive found-cell address against this saved address.

To find cells that match more complicated patterns, use a Fo
Each...Next statement with the Like operator. For example, th
following code searches for all cells in the range A1:C5 that use
font whose name starts with the letters Cour. When Microsoft Exce
finds a match, it changes the font to Times New Roman.

For Each c In [A1:C5]
If c.Font.Name Like "Cour*" Then
c.Font.Name = "Times New Roman"
End If
Next
Example
This example finds all cells in the range A1:A500 on worksheet one tha
contain the value 2 and changes it to 5.

With Worksheets(1).Range("a1:a500")
Set c = .Find(2, lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Value = 5
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
============================
..that finds specific items....but if you was to make the specific a
variable based upon the data entered into an input function...it should
work with a bit of work?!


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Placing a 'find'(ctrl+F) button in a UserForm

I put a button on a userform and double clicked on it and used this code:

Option Explicit
Private Sub CommandButton1_Click()
Me.Hide
Application.Dialogs(xlDialogFormulaFind).Show
Me.Show
End Sub



"abxy <" wrote:

Alright, i'm trying to have a command button on my userform that, when
pressed, will hide UserForm, bring up the the Find dialog box (ctrl+F),
and then, when i'm done with using find and close it, the UserForm will
unhide and return...I know this seems a little difficult, but how could
i accomplish this?

Thanks in advance mates :)

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson

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
Find (or Ctrl-F) command Kyle Excel Discussion (Misc queries) 1 November 27th 07 07:12 AM
find number within database without using ctrl+f key Montu Excel Worksheet Functions 1 November 15th 07 11:14 AM
Placing a Command Button in a New Tool Menu Office Junior[_2_] Excel Discussion (Misc queries) 2 May 12th 07 04:50 PM
placing a button directly in a sheet kemel Excel Discussion (Misc queries) 1 August 1st 06 03:25 PM
Excel can't find the end of the spreadsheet (Ctrl+end) verc Excel Worksheet Functions 2 November 2nd 04 06:51 AM


All times are GMT +1. The time now is 09:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"