VBA SearchOrder:= ?? (Show all possible values)


New Member
Jun 22, 2006
Cells.Replace What:=UserForm1.TextBox1.Text, _
Replacement:=UserForm1.TextBox2.Text, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

If I am typing in the above line as part of a VBA Macro in the IDE, intellisense helps me a lot. As soon as I type in "Cells." it shows me all functions I can call (Replace, Offset, etc...) so I can just choose from one of them.

Is there a similar intellisense help available for what to put after I type in SearchOrder:=" ???
In other words, how could I quickly see what all the xl... constants are that I could put after the SearchOrder:= , it would be nice to see all the possible values (xlByRows, xlByColumns, ...). I am actually looking for something that would show this for any function (show all possible parameter values for any given function parameter)

I tried rightmouse/properties,methods but that is showing way too much stuff.


Board Regular
Mar 25, 2009
Here is how you check all the possible values for SearchOrder.

1) Open Excel
2) Alt + F11. Opens Visual Basic Editor.
3) Press F2. Opens Object Browser.
4) You are looking for replace function. Type Replace in the Search option. Enter.
5) Once the list is populated, Look for "Excel Range Replace" in the list.
6) Right click and click help. Brings the help window.
7) Read the help file it will tell you what constants you can apply for SearchOrder.

In this case you can only apply xlByRows or xlByColumns. Hope this helps.

Forum statistics

Latest member
Ankur Teotia

Some videos you may like

This Week's Hot Topics

  • VBA code giving errors and stopping Excel
    Hello Experts, I have this code being used to loop through files in a file path, and copy specific data to another sheet. It is giving me several...
  • Disable MsgBox message
    Morning, I have a userform where if i leave a ComboBox empty i see a MsgBox warning me that i must enter an invoice number. It is this MsgBox i...
  • Macro Recorder into VBA, Copy Paste Data Filled Cells
    Hi Everyone, I have a macro recorder file that takes a selection of data, copies, then pastes into a new sheet on ("A2:B2") The issue is my...
  • Number format changes while pasting into a cell
    Hi, I am trying to paste a number 180204524303 from an email to an excel cell, however, whenever i try to do so , the the paste value appears as...
  • Collating data
    Hello all. Could someone please help. I am trying to pull all column data from multiple sheets (24 I total so far) into 1 master sheet without...
  • Sum Multiple Columns Based on Multiple Criteria
    I am trying to consolidate data by summing columns G through M based on material, plant, vendor, and fiscal year being identical. The period does...