+ Reply to Thread
Results 1 to 9 of 9

Search for value in a column containing formula

  1. #1
    Registered User
    Join Date
    04-12-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    31

    Search for value in a column containing formula

    hi all, i am little stuck with how to search for a value in a column which contains formula. The first row in the column has date as 11/28/2011. and after that in all position where there is a requirement it replace by formula..like a1+1 where a1 refers to the first row value in the column.
    Now say i need to search for 12/29/2011..the search function returns nothing.can it be done....your help would be appreciated.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Search for value in a column containing formula

    Hi
    in the search box, click on "options", then change "Look in" from "Formulas" to "Values"

  3. #3
    Registered User
    Join Date
    04-12-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Search for value in a column containing formula

    I have a macro which searches for a specific cell in another work and not in the same workbook....and the search occurs at runtime...
    So i was looking for a solution...for doing this...can it be done

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Search for value in a column containing formula

    if you post your macro, we can take a look

  5. #5
    Registered User
    Join Date
    04-12-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Search for value in a column containing formula

    sFile = ThisWorkbook.Path & "\" & "myfile.xls"
    MsgBox s

    Set Wb = Application.Workbooks.Open(sFile, ReadOnly:=False, editable:=True, UpdateLinks:=xlUpdateLinksNever)

    sh = Wb.ActiveSheet.Name

    Wb.ActiveSheet.Range("A:A").Activate

    stringToFind = Application.InputBox("Enter invoice Number to find?", _
    "Search String")

    If Trim(stringToFind) = "" Then Exit Sub

    Set FoundRange = Cells.Find(What:=stringToFind, _
    After:=Range("A1"), LookIn:=xlFormulas, LookAt:=xlPart, _
    SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)

    If Not (FoundRange Is Nothing) Then
    Set ValueCell = FoundRange.Offset(0, 6)
    ValueCell.Value = ValueCell.Value + 1
    Else
    MsgBox "NO MATCH"
    End If

  6. #6
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Search for value in a column containing formula

    Hi
    you might be advised to put code marks around your code, or a moderator might freeze this thread for not complying with forum rules

    this slight variation worked for me:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-12-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Search for value in a column containing formula

    Thanks for your time but it doesn't work for me. The cell in A2 has actually a date say 11/28/2009 and then there is a date after every seven cells...but that date is calculation based on cell A2...so that means now in cell A9 it will be =A2+1 that reflect 11/29/2009 but it cannot search when i enter 11/29/2009 in input box.....Can that search be possible or since its referring to other cells value search cannot be accomplished.

  8. #8
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Search for value in a column containing formula

    Hi
    try changing "LookIn:=xlFormulas" to "LookIn:=xlValues"

  9. #9
    Registered User
    Join Date
    04-12-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Search for value in a column containing formula

    Thanks NickyC for your help...but the problem was that i was inputting ....11/12/12....which was incorrect and when i entered 11/12/2012...it did work for me...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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