+ Reply to Thread
Results 1 to 3 of 3

Range.Find method - Address meeting search criteria in r,c rather tha "A3" (say) format

Hybrid View

Hafod Range.Find method - Address... 06-24-2012, 02:01 PM
JoeMo Re: Range.Find method -... 06-24-2012, 02:54 PM
JoeMo Re: Range.Find method -... 06-24-2012, 02:55 PM
  1. #1
    Registered User
    Join Date
    06-24-2012
    Location
    Wales, UK
    MS-Off Ver
    Excel 2003
    Posts
    3

    Range.Find method - Address meeting search criteria in r,c rather tha "A3" (say) format

    Hi
    I am trying to get to grips with Find / Findfirst Excel methods to use as function call in an application that I am developing. The prototype code to understand this (find) approach is gven below which does work and features within this forum.

    However how can I get the address in r,c format rather than "A3" say. If I can get the corresponding row / col values as integers then I can develop the algorithm to do processing on the data in this specific cell (which will use iterative loops. Hence need for r,c.

    Many thanks in anticipation

    Code
    Dim strSearch As String
    Dim aCell As Range
    Dim oSht As Worksheet

    On Error GoTo Err

    Set oSht = Sheets("All")

    'lastRow = oSht.Range("A" & Rows.Count).End(xlUp).Row
    LastCol = oSht.Range("A1:H1").End(xlUp).Column

    strSearch = "In LEA care"

    Set aCell = oSht.Range("A1:H1").Find(What:=strSearch, LookIn:=xlValues, _
    LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False)

    If Not aCell Is Nothing Then
    MsgBox "Value Found in Cell " & aCell.Address


    End If

    Exit Sub
    Err:
    MsgBox Err.Description

    /Code

  2. #2
    Registered User
    Join Date
    05-16-2012
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Range.Find method - Address meeting search criteria in r,c rather tha "A3" (say) forma

    Dim r as long, c as long

    'your code

    r = aCell.Row
    c = aCell.Column
    'aCell can be referenced as Cells(r,c)

  3. #3
    Registered User
    Join Date
    05-16-2012
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Range.Find method - Address meeting search criteria in r,c rather tha "A3" (say) forma

    Dim r as long, c as long

    'your code

    r = aCell.Row
    c = aCell.Column
    'aCell can be referenced as Cells(r,c)

+ 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.6.0 RC 1