+ Reply to Thread
Results 1 to 5 of 5

find text in a cell and make cell 2 cells below that active

Hybrid View

  1. #1
    shark102
    Guest

    find text in a cell and make cell 2 cells below that active

    hello

    my second post here, still learning VBA.
    My question is pretty much included in the subject.
    I need to find a cell in worksheet that contains text "descr1" - there is
    only 1 cell like this in the worksheet - it is in a header, and make cell 2
    cells below that active

    any help is greatly appreciated


  2. #2
    Stefi
    Guest

    RE: find text in a cell and make cell 2 cells below that active

    Hi,

    Try this:

    Cells.Find(What:="descr1", After:=ActiveCell, LookIn:=xlValues, LookAt _
    :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
    MatchCase:= _
    False).Activate
    Cells(ActiveCell.Row + 2, ActiveCell.Column).Select

    Regards,
    Stefi

    „shark102” ezt *rta:

    > hello
    >
    > my second post here, still learning VBA.
    > My question is pretty much included in the subject.
    > I need to find a cell in worksheet that contains text "descr1" - there is
    > only 1 cell like this in the worksheet - it is in a header, and make cell 2
    > cells below that active
    >
    > any help is greatly appreciated
    >


  3. #3
    shark102
    Guest

    RE: find text in a cell and make cell 2 cells below that active

    ok Stefis method works, now I need to name this workshhet after value in
    selected cell

    sorry not to have written it in the first post

    "Stefi" wrote:

    > Hi,
    >
    > Try this:
    >
    > Cells.Find(What:="descr1", After:=ActiveCell, LookIn:=xlValues, LookAt _
    > :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
    > MatchCase:= _
    > False).Activate
    > Cells(ActiveCell.Row + 2, ActiveCell.Column).Select
    >
    > Regards,
    > Stefi
    >
    > „shark102” ezt *rta:
    >
    > > hello
    > >
    > > my second post here, still learning VBA.
    > > My question is pretty much included in the subject.
    > > I need to find a cell in worksheet that contains text "descr1" - there is
    > > only 1 cell like this in the worksheet - it is in a header, and make cell 2
    > > cells below that active
    > >
    > > any help is greatly appreciated
    > >


  4. #4
    shark102
    Guest

    RE: find text in a cell and make cell 2 cells below that active

    I got it, no more help needed, thanks everybody for the effort.

    "shark102" wrote:

    > ok Stefis method works, now I need to name this workshhet after value in
    > selected cell
    >
    > sorry not to have written it in the first post
    >
    > "Stefi" wrote:
    >
    > > Hi,
    > >
    > > Try this:
    > >
    > > Cells.Find(What:="descr1", After:=ActiveCell, LookIn:=xlValues, LookAt _
    > > :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
    > > MatchCase:= _
    > > False).Activate
    > > Cells(ActiveCell.Row + 2, ActiveCell.Column).Select
    > >
    > > Regards,
    > > Stefi
    > >
    > > „shark102” ezt *rta:
    > >
    > > > hello
    > > >
    > > > my second post here, still learning VBA.
    > > > My question is pretty much included in the subject.
    > > > I need to find a cell in worksheet that contains text "descr1" - there is
    > > > only 1 cell like this in the worksheet - it is in a header, and make cell 2
    > > > cells below that active
    > > >
    > > > any help is greatly appreciated
    > > >


  5. #5
    paul.robinson@it-tallaght.ie
    Guest

    Re: find text in a cell and make cell 2 cells below that active

    Hi

    Dim Sht as worksheet
    Dim FoundCell as Range

    'replace with your workbook and worksheet if required
    Set Sht = Activeworkbook.Activeworksheet

    With Sht
    Set FoundCell = .Find("descr1", .Cells(1, 1), , , xlByColumns)
    end with
    If not FoundCell is Nothing then
    Sht.Activate 'if not active already
    FoundCell.offset(2,0).Activate
    end if


    Highlight Find in the editor and hit F1 key to look at its parameters
    regards
    Paul

    shark102 wrote:
    > hello
    >
    > my second post here, still learning VBA.
    > My question is pretty much included in the subject.
    > I need to find a cell in worksheet that contains text "descr1" - there is
    > only 1 cell like this in the worksheet - it is in a header, and make cell 2
    > cells below that active
    >
    > any help is greatly appreciated



+ 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