+ Reply to Thread
Results 1 to 6 of 6

Find cell

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-29-2014
    MS-Off Ver
    Office 2013
    Posts
    115

    Find cell

    Good afternoon everybody!
    i am trying to create a VBA Code for finding a text but i don't want the code to search through all sheet.
    Is there any way to tell VBA to search in specific rows, for exp the first?
    Usually i use the fist row to title the columns so i want to search by the head columns.
    Let's assume that i want to find and select the cell with the text "Account Number".
    I use this code but this goes to all the cells:
        Cells.Find(What:="Account Number", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
            :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
            False, SearchFormat:=False).Activate
    DO YOU GUYS HAVE A BETTER IDEA?

    Thanks in advance for your help
    Last edited by Leith Ross; 06-17-2014 at 05:52 PM. Reason: Added Code Tags

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Find cell

    Rows(1).Find(...
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    05-29-2014
    MS-Off Ver
    Office 2013
    Posts
    115

    Re: Find cell

    Thanks man, but it doesn't work.

  4. #4
    Forum Contributor
    Join Date
    03-21-2012
    Location
    Ho Chi Minh city
    MS-Off Ver
    Excel 2003
    Posts
    180

    Re: Find cell

    PHP Code: 
    Option Explicit
    Sub Macro1
    ()
     
    Dim Rng As RangesRng As Range
     
     Set Rng 
    ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants2)
     
    'MsgBox Rng.Address'
     
    Set sRng Rng.Find(". . .", , xlFormulasxlPart)
     
    End Sub 

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,697

    Re: Find cell

    Thanks man, but it doesn't work.
    You have to do some things yourself also.

    Rows(1).Find(What:="Account Number", After:=Cells(1, 1), LookIn:=xlFormulas, LookAt _
    :=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
    False, SearchFormat:=False).Activate

  6. #6
    Forum Contributor
    Join Date
    05-29-2014
    MS-Off Ver
    Office 2013
    Posts
    115

    Re: Find cell

    thanks to all of you guys

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Use a specific cell reference to find and overwrite that row(Find and Copy).
    By Abbadon486 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2014, 11:57 AM
  2. Find blank cell, insert formula to find median of above cell range
    By lilyeye in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-05-2013, 11:58 AM
  3. [SOLVED] Trying to find a formula to find a random $ amount in a text in a cell
    By Miki1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2013, 10:13 PM
  4. [SOLVED] Find match, find related cell and return that number
    By HelpHelpHelp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-17-2012, 06:46 AM
  5. Range.Find to find column and place value in next available cell in one line
    By davegugg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2011, 10:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1