Seek
Seek
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Seek

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I want to write a macro that first give me the possibility to enter a message in a text box and then give me the active cell.
    Ex. I have 700 lines in column A AAA
    BBB
    CCC
    DDD
    etc..

    When I can give in a textbox DDD than the program goes automatickly to line 4 with the text DDD
    Have anyone such a macro?
    Many thanks.

  2. #2
    Board Regular eliW's Avatar
    Join Date
    Mar 2002
    Posts
    1,919
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-29 05:49, verluc wrote:
    I want to write a macro that first give me the possibility to enter a message in a text box and then give me the active cell.
    Ex. I have 700 lines in column A AAA
    BBB
    CCC
    DDD
    etc..

    When I can give in a textbox DDD than the program goes automatickly to line 4 with the text DDD
    Have anyone such a macro?
    Many thanks.
    Hi,
    I am far from being an expert in VBA but I tried this and it seems to work, although maybe it needs some polish:

    Sub SeekValue()
    Range("A1").Select
    ABC = InputBox("Enter value to seek ")
    Cells.Find(What:=ABC, After:=ActiveCell).Activate
    End Sub

    Regards,
    Eli


    [ This Message was edited by: eliW on 2002-03-29 07:14 ]

  3. #3
    Board Regular eliW's Avatar
    Join Date
    Mar 2002
    Posts
    1,919
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Does it make sense?
    Eli

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-29 06:42, eliW wrote:
    On 2002-03-29 05:49, verluc wrote:
    I want to write a macro that first give me the possibility to enter a message in a text box and then give me the active cell.
    Ex. I have 700 lines in column A AAA
    BBB
    CCC
    DDD
    etc..

    When I can give in a textbox DDD than the program goes automatickly to line 4 with the text DDD
    Have anyone such a macro?
    Many thanks.
    Hi,
    I am far from being an expert in VBA but I tried this and it seems to work, although maybe it needs some polish:

    Sub SeekValue()
    Range("A1").Select
    ABC = InputBox("Enter value to seek ")
    Cells.Find(What:=ABC, After:=ActiveCell).Activate
    End Sub

    Regards,
    Eli
    Yes,it works.But what if the program don't find it,or is does not exist?Can the program me give a message: "Can't find it !!!"
    Many thanks

    [ This Message was edited by: eliW on 2002-03-29 07:14 ]

  5. #5
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Just change Eli's code to;

    Sub SeekValue()
    Dim abc

    Range("A1").Select
    abc = InputBox("Enter value to seek ")
    On Error Resume Next
    Cells.Find(What:=abc, After:=ActiveCell).Activate
    If Err Then MsgBox abc & " Not found!"

    End Sub


    Ivan

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com