+ Reply to Thread
Results 1 to 5 of 5

Cannot select cell with formula

Hybrid View

  1. #1
    Registered User
    Join Date
    08-29-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    3

    Cannot select cell with formula

    Hello all,

    I am running this simple formula:
    =INDEX(C2:C16,MATCH(TRUE,INDEX(C2:C16> 10,0),))

    But i would like to make a VBA that select the cell where the answer was found instead of writing the answer in a new cell.

    I am looking to find the first value over 10 in a column and select it. It is very important to select to cell for my macro to work.

    Can anyone help me please, i have been looking for an answer for hours but i am stomped.

    Thank you in advance

  2. #2
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Cannot select cell with formula

    Are you asking to have the VBA Match on this value and then select that cell ADDRESS?

    If so, a combination of Cells and Worksheetfunction.Match should do it. If you share your current code in a sample workbook with mock data, one of us will gladly assist.

    Please take an attempt at doing this so that I or someone here can guide you where it is not working IF you don't get it by yourself!

    Good Luck!
    -If you think you are done, Start over - ELeGault

  3. #3
    Registered User
    Join Date
    08-29-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    3

    Re: Cannot select cell with formula

    I think this is what im trying to do. Sorry my question is not clear i am till a novice. I will try to clarify.

    Here is the data i have (exemple):
    0
    0
    2
    3
    4
    4
    4
    5
    6
    7
    7
    9
    10
    11
    13
    13
    15
    ...

    I am trying to make a macro that will find the first number greater than 10 and select it (the cell it is in).

  4. #4
    Registered User
    Join Date
    08-29-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    3

    Re: Cannot select cell with formula

    I replied but not directly to you, did it make a difference ?

  5. #5
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Cannot select cell with formula

    Well to start off your data is in the incorrect order to utilize "MATCH" as finding a value where it is greater than or Exact requires a Descending order.

    So I will not go down that path unless you wish to reorganize your data!

    I would probably do something like this (Forgive me if any syntax is off as my current terminal does not have Excel on it)

    Now this will require your list to be in column 1, change the 1 reference found in the Cells function below

    Sub SelCell()
    Dim i As Long
    Dim x As Long
    
    i = 0
    Do Until x > 10
    i = i + 1
    If IsEmpty(Cells(i, 1).Value) = True Then
        MsgBox ("Could Not Find Match")
        Exit Sub
        End If
    x = Cells(i, 1).Value
    Loop
    
    Cells(i, 1).Select
    
    End Sub
    Good Luck

    EDIT: Added the error catching just in case (Again Syntax may be off but looks visually correct to me)
    Last edited by ELeGault; 08-29-2016 at 11:55 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. Double Clicking Cell To Select Choice Data For Another Cell's Formula
    By Rondeez in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-03-2015, 09:53 AM
  2. Formula to select specific numbers from a cell and input into another cell
    By highrankednoob in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-12-2013, 06:28 PM
  3. Replies: 10
    Last Post: 07-08-2013, 01:47 PM
  4. [SOLVED] Using the value in one cell to select another for use in a formula
    By cattlevet in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2012, 05:51 AM
  5. Replies: 2
    Last Post: 03-17-2012, 08:42 PM
  6. Select a cell with conditional formating having a formula for a cell address?
    By EXCELOST in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2010, 06:19 AM
  7. How to select preceeding cell in a formula?
    By Dennis in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-21-2006, 12:55 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