Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find (or Ctrl-F) command | Excel Discussion (Misc queries) | |||
find number within database without using ctrl+f key | Excel Worksheet Functions | |||
Placing a Command Button in a New Tool Menu | Excel Discussion (Misc queries) | |||
placing a button directly in a sheet | Excel Discussion (Misc queries) | |||
Excel can't find the end of the spreadsheet (Ctrl+end) | Excel Worksheet Functions |