+ Reply to Thread
Results 1 to 4 of 4

Thread: Need help with searching

  1. #1
    Registered User
    Join Date
    04-27-2008
    Posts
    2

    Need help with searching

    hello I am not very good at excel or Visual Basic and am having issues getting a report to do what I want.

    Basically I need to search a column of data for a value and return the first matching cell. In this column I want to search for a specific number. The catch is that the column I am searching in has a lot of data (log entries with line breaks).

    I can get the search function to return a value, but it just returns a number and that number is the index of where it found the data in the corresponding cell. so I can't use that number to return the actual value of the cell where it finds a match.

    Sorry if this is somewhere else already (I'm sure it is), but my searching abilities are apparently not good enough to find it.

  2. #2
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    02-15-2008
    Location
    Grappenhall, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    6,566
    Quote Originally Posted by Hojo52
    hello I am not very good at excel or Visual Basic and am having issues getting a report to do what I want.

    Basically I need to search a column of data for a value and return the first matching cell. In this column I want to search for a specific number. The catch is that the column I am searching in has a lot of data (log entries with line breaks).

    I can get the search function to return a value, but it just returns a number and that number is the index of where it found the data in the corresponding cell. so I can't use that number to return the actual value of the cell where it finds a match.

    Sorry if this is somewhere else already (I'm sure it is), but my searching abilities are apparently not good enough to find it.
    Hi,

    I don't quite follow this. You seem to be asking to find a specific number in a column, and then report what that number is. But since you're searching for it you already know what it is. Clearly I'm missing something.

    Can you explain in another way exactly what you're trying to find, with a specific example perhaps. For instance search for number 7 in a column which contains 1,2,A, 7, 79, J43, 697, Joe... or whatever, and what you expect the result to be.

    Rgds

  3. #3
    Registered User
    Join Date
    04-27-2008
    Posts
    2
    Sure ...

    I have a spreadsheet with a column in it that has log entries.
    Example log entry - "243453-File missing header info..."

    In this column I have multiple log entries per cell. So each cell could have 30 lines of entries seperated by line breaks.

    I want to search this column for the number 243453 and return the content of the first cell that has this number in it.

    I hope this helps.

  4. #4
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    02-15-2008
    Location
    Grappenhall, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    6,566
    Quote Originally Posted by Hojo52
    Sure ...

    I have a spreadsheet with a column in it that has log entries.
    Example log entry - "243453-File missing header info..."

    In this column I have multiple log entries per cell. So each cell could have 30 lines of entries seperated by line breaks.

    I want to search this column for the number 243453 and return the content of the first cell that has this number in it.

    I hope this helps.
    One way:

    Sub FindWholeCellValues()
    Dim stCellValue As String
    stCellValue = Range("A:A").Find(what:="243453")
    MsgBox stCellValue
    End Sub
    HTH

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0