+ Reply to Thread
Results 1 to 6 of 6

Macro to find a variable (indirect) value in a database

Hybrid View

  1. #1
    Registered User
    Join Date
    01-18-2014
    Location
    Jeffreysbay, South Africa
    MS-Off Ver
    MAC 2011
    Posts
    10

    Post Macro to find a variable (indirect) value in a database

    I want to use the find function in a macro to find a value in field B3 in a database F7:H20. The curser should then end up in the field containing the value. The value in B3 is inputted just before the Macro is executed.
    I am using the following code but cannot change the value ff292 during the execution as it is now hard coded in the macro - please for some help

    Cells.find(What:="ff292", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
            :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
            False).Activate

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Macro to find a variable (indirect) value in a database

    Sample workbook please

  3. #3
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Macro to find a variable (indirect) value in a database

    A sample would help... but if you just need to add the value in B3 to the find function, this is where you would do that:


    RANGE("F7:H20").find(What:=range("B3").value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
            :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
            False).SELECT
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  4. #4
    Registered User
    Join Date
    01-18-2014
    Location
    Jeffreysbay, South Africa
    MS-Off Ver
    MAC 2011
    Posts
    10

    Re: Macro to find a variable (indirect) value in a database

    GeneralDisarray, you are a star. Perfect solution. The" =range("b3").value" did the trick.

    Thanks for your help

  5. #5
    Registered User
    Join Date
    01-18-2014
    Location
    Jeffreysbay, South Africa
    MS-Off Ver
    MAC 2011
    Posts
    10

    Re: Macro to find a variable (indirect) value in a database

    [solved]thanks for quick response

  6. #6
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Macro to find a variable (indirect) value in a database

    sorry, duplicated...
    Last edited by GeneralDisarray; 07-28-2015 at 03:23 PM.

+ 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. [SOLVED] INDIRECT lookup on variable row
    By speeder in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-28-2013, 10:28 AM
  2. Use INDIRECT to COUNTIF a Variable Range on a 2nd sheet
    By hotred_streak in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-29-2013, 04:06 PM
  3. Replies: 6
    Last Post: 12-21-2012, 08:03 AM
  4. [SOLVED] macro loop through variable range to find blank, add formula
    By sammar12 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2012, 11:39 AM
  5. Macro Find Variable Search Criteria
    By KA0DOC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2011, 03:49 PM
  6. Indirect formula and variable sheet name
    By quik80 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2011, 05:37 PM
  7. Indirect Variable
    By mycon73 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-21-2008, 12:01 AM
  8. Replies: 5
    Last Post: 06-11-2006, 04:45 PM

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