+ Reply to Thread
Results 1 to 7 of 7

Store row number after a find

  1. #1
    Alan
    Guest

    Store row number after a find

    Following a find command I want to store the row number to a variablke and
    use that to move to a columb on that row

  2. #2
    FSt1
    Guest

    RE: Store row number after a find

    hi,
    what column? same column? different column?

    Regards
    FSt1

    "Alan" wrote:

    > Following a find command I want to store the row number to a variablke and
    > use that to move to a columb on that row


  3. #3
    Alan
    Guest

    RE: Store row number after a find

    Hello,

    Any column on that row. Real problem is storing the 'found' row number to a
    variable

    "FSt1" wrote:

    > hi,
    > what column? same column? different column?
    >
    > Regards
    > FSt1
    >
    > "Alan" wrote:
    >
    > > Following a find command I want to store the row number to a variablke and
    > > use that to move to a columb on that row


  4. #4
    FSt1
    Guest

    RE: Store row number after a find

    hi,
    if you are using the built in find then you do have a problem. try this...
    Sub macfindrow()
    dim rn as string
    dim rng as range
    dim therow as long

    rn = inputbox("enter something to find")
    if rn <> "" then
    Set rng = nothing
    Set rng = range("A1:IV65536").Find(what:=rn, _
    After:=Range("A1"), _
    Lookin:=xlformulas, _
    Lookat:=xlpart, _
    SearchOrder:=xlbyrows, _
    SearchDirection:=xlNext, _
    MatchCase:=false)
    end if
    therow = rng.row
    msgbox "Found at cell " & rng.address
    msbbox "The row number is " & therow
    end sub

    therow is the variable

    Regards
    FSt1
    "Alan" wrote:

    > Hello,
    >
    > Any column on that row. Real problem is storing the 'found' row number to a
    > variable
    >
    > "FSt1" wrote:
    >
    > > hi,
    > > what column? same column? different column?
    > >
    > > Regards
    > > FSt1
    > >
    > > "Alan" wrote:
    > >
    > > > Following a find command I want to store the row number to a variablke and
    > > > use that to move to a columb on that row


  5. #5
    Alan
    Guest

    RE: Store row number after a find

    Dear FSt1,

    Thanks very good. I have modified slightly and now all is OK.

    What does FSt1 mean or stand for ?

    Alan

    "FSt1" wrote:

    > hi,
    > if you are using the built in find then you do have a problem. try this...
    > Sub macfindrow()
    > dim rn as string
    > dim rng as range
    > dim therow as long
    >
    > rn = inputbox("enter something to find")
    > if rn <> "" then
    > Set rng = nothing
    > Set rng = range("A1:IV65536").Find(what:=rn, _
    > After:=Range("A1"), _
    > Lookin:=xlformulas, _
    > Lookat:=xlpart, _
    > SearchOrder:=xlbyrows, _
    > SearchDirection:=xlNext, _
    > MatchCase:=false)
    > end if
    > therow = rng.row
    > msgbox "Found at cell " & rng.address
    > msbbox "The row number is " & therow
    > end sub
    >
    > therow is the variable
    >
    > Regards
    > FSt1
    > "Alan" wrote:
    >
    > > Hello,
    > >
    > > Any column on that row. Real problem is storing the 'found' row number to a
    > > variable
    > >
    > > "FSt1" wrote:
    > >
    > > > hi,
    > > > what column? same column? different column?
    > > >
    > > > Regards
    > > > FSt1
    > > >
    > > > "Alan" wrote:
    > > >
    > > > > Following a find command I want to store the row number to a variablke and
    > > > > use that to move to a columb on that row


  6. #6
    FSt1
    Guest

    RE: Store row number after a find

    my name is Frank Stone
    FStone
    FSt one
    how do you spell the number 1

    Regards
    FSt1

    "Alan" wrote:

    > Dear FSt1,
    >
    > Thanks very good. I have modified slightly and now all is OK.
    >
    > What does FSt1 mean or stand for ?
    >
    > Alan
    >
    > "FSt1" wrote:
    >
    > > hi,
    > > if you are using the built in find then you do have a problem. try this...
    > > Sub macfindrow()
    > > dim rn as string
    > > dim rng as range
    > > dim therow as long
    > >
    > > rn = inputbox("enter something to find")
    > > if rn <> "" then
    > > Set rng = nothing
    > > Set rng = range("A1:IV65536").Find(what:=rn, _
    > > After:=Range("A1"), _
    > > Lookin:=xlformulas, _
    > > Lookat:=xlpart, _
    > > SearchOrder:=xlbyrows, _
    > > SearchDirection:=xlNext, _
    > > MatchCase:=false)
    > > end if
    > > therow = rng.row
    > > msgbox "Found at cell " & rng.address
    > > msbbox "The row number is " & therow
    > > end sub
    > >
    > > therow is the variable
    > >
    > > Regards
    > > FSt1
    > > "Alan" wrote:
    > >
    > > > Hello,
    > > >
    > > > Any column on that row. Real problem is storing the 'found' row number to a
    > > > variable
    > > >
    > > > "FSt1" wrote:
    > > >
    > > > > hi,
    > > > > what column? same column? different column?
    > > > >
    > > > > Regards
    > > > > FSt1
    > > > >
    > > > > "Alan" wrote:
    > > > >
    > > > > > Following a find command I want to store the row number to a variablke and
    > > > > > use that to move to a columb on that row


  7. #7
    Alan
    Guest

    RE: Store row number after a find

    Frank,

    Can you help with an embelishment to your solution. How can I trap a NO FIND
    following the find command you supplied

    "FSt1" wrote:

    > my name is Frank Stone
    > FStone
    > FSt one
    > how do you spell the number 1
    >
    > Regards
    > FSt1
    >
    > "Alan" wrote:
    >
    > > Dear FSt1,
    > >
    > > Thanks very good. I have modified slightly and now all is OK.
    > >
    > > What does FSt1 mean or stand for ?
    > >
    > > Alan
    > >
    > > "FSt1" wrote:
    > >
    > > > hi,
    > > > if you are using the built in find then you do have a problem. try this...
    > > > Sub macfindrow()
    > > > dim rn as string
    > > > dim rng as range
    > > > dim therow as long
    > > >
    > > > rn = inputbox("enter something to find")
    > > > if rn <> "" then
    > > > Set rng = nothing
    > > > Set rng = range("A1:IV65536").Find(what:=rn, _
    > > > After:=Range("A1"), _
    > > > Lookin:=xlformulas, _
    > > > Lookat:=xlpart, _
    > > > SearchOrder:=xlbyrows, _
    > > > SearchDirection:=xlNext, _
    > > > MatchCase:=false)
    > > > end if
    > > > therow = rng.row
    > > > msgbox "Found at cell " & rng.address
    > > > msbbox "The row number is " & therow
    > > > end sub
    > > >
    > > > therow is the variable
    > > >
    > > > Regards
    > > > FSt1
    > > > "Alan" wrote:
    > > >
    > > > > Hello,
    > > > >
    > > > > Any column on that row. Real problem is storing the 'found' row number to a
    > > > > variable
    > > > >
    > > > > "FSt1" wrote:
    > > > >
    > > > > > hi,
    > > > > > what column? same column? different column?
    > > > > >
    > > > > > Regards
    > > > > > FSt1
    > > > > >
    > > > > > "Alan" wrote:
    > > > > >
    > > > > > > Following a find command I want to store the row number to a variablke and
    > > > > > > use that to move to a columb on that row


+ 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