+ Reply to Thread
Results 1 to 9 of 9

Border help

  1. #1
    erikkeith via OfficeKB.com
    Guest

    Border help

    After finding a specific cell how can I set borders for the entire row? For
    instance:

    Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
    , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).EntireRow.Activate

    I try to set up the borders for that entire row but it is not working. Help?

    --
    Message posted via OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...mming/200605/1

  2. #2
    Ron de Bruin
    Guest

    Re: Border help

    Hi erikkeith

    Record a macro when you do this en then look at the code

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "erikkeith via OfficeKB.com" <u13156@uwe> wrote in message news:5fe2a77d1e9b6@uwe...
    > After finding a specific cell how can I set borders for the entire row? For
    > instance:
    >
    > Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
    > , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    > MatchCase:=False, SearchFormat:=False).EntireRow.Activate
    >
    > I try to set up the borders for that entire row but it is not working. Help?
    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.a...mming/200605/1




  3. #3
    erikkeith via OfficeKB.com
    Guest

    Re: Border help

    You must not have understood my question. I want to be able to set up the
    borders for cells A:O on the row that the "find" found what I was looking for.
    .....that being "Totals"

    Ron de Bruin wrote:
    >Hi erikkeith
    >
    >Record a macro when you do this en then look at the code
    >
    >> After finding a specific cell how can I set borders for the entire row? For
    >> instance:

    >[quoted text clipped - 4 lines]
    >>
    >> I try to set up the borders for that entire row but it is not working. Help?


    --
    Message posted via http://www.officekb.com

  4. #4
    erikkeith via OfficeKB.com
    Guest

    Re: Border help

    You must not have understood my question. I want to be able to set up the
    borders for cells A:O on the row that the "find" found what I was looking for.
    .....that being "Totals"

    Ron de Bruin wrote:
    >Hi erikkeith
    >
    >Record a macro when you do this en then look at the code
    >
    >> After finding a specific cell how can I set borders for the entire row? For
    >> instance:

    >[quoted text clipped - 4 lines]
    >>
    >> I try to set up the borders for that entire row but it is not working. Help?


    --
    Message posted via OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...mming/200605/1

  5. #5
    Ron de Bruin
    Guest

    Re: Border help

    You select the row with your code so if you record a macro you can add this to your code

    Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
    , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).EntireRow.Activate

    Selection.Borders(xlEdgeLeft).LineStyle = xlContinuous
    Selection.Borders(xlEdgeTop).LineStyle = xlContinuous
    Selection.Borders(xlEdgeBottom).LineStyle = xlContinuous
    Selection.Borders(xlEdgeRight).LineStyle = xlContinuous


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "erikkeith via OfficeKB.com" <u13156@uwe> wrote in message news:5fe3c2428134c@uwe...
    > You must not have understood my question. I want to be able to set up the
    > borders for cells A:O on the row that the "find" found what I was looking for.
    > ....that being "Totals"
    >
    > Ron de Bruin wrote:
    >>Hi erikkeith
    >>
    >>Record a macro when you do this en then look at the code
    >>
    >>> After finding a specific cell how can I set borders for the entire row? For
    >>> instance:

    >>[quoted text clipped - 4 lines]
    >>>
    >>> I try to set up the borders for that entire row but it is not working. Help?

    >
    > --
    > Message posted via http://www.officekb.com




  6. #6
    erikkeith via OfficeKB.com
    Guest

    Re: Border help

    Yes, but how can I do it for just cells A through O? I find "Totals" on row
    100 and then want cells adjust the borders for cells A:O for just that row. ?
    ????

    Ron de Bruin wrote:
    >You select the row with your code so if you record a macro you can add this to your code
    >
    >Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
    > , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    > MatchCase:=False, SearchFormat:=False).EntireRow.Activate
    >
    > Selection.Borders(xlEdgeLeft).LineStyle = xlContinuous
    > Selection.Borders(xlEdgeTop).LineStyle = xlContinuous
    > Selection.Borders(xlEdgeBottom).LineStyle = xlContinuous
    > Selection.Borders(xlEdgeRight).LineStyle = xlContinuous
    >
    >> You must not have understood my question. I want to be able to set up the
    >> borders for cells A:O on the row that the "find" found what I was looking for.

    >[quoted text clipped - 9 lines]
    >>>>
    >>>> I try to set up the borders for that entire row but it is not working. Help?


    --
    Message posted via http://www.officekb.com

  7. #7
    Ron de Bruin
    Guest

    Re: Border help

    Sub test()
    Dim rng As Range

    Set rng = Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
    , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False)

    If Not rng Is Nothing Then
    With rng.Resize(1, 15)
    .Borders(xlEdgeLeft).LineStyle = xlContinuous
    .Borders(xlEdgeTop).LineStyle = xlContinuous
    .Borders(xlEdgeBottom).LineStyle = xlContinuous
    .Borders(xlEdgeRight).LineStyle = xlContinuous
    End With
    Else
    MsgBox "Nothing found"
    End If

    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "erikkeith via OfficeKB.com" <u13156@uwe> wrote in message news:5fe44c41489a1@uwe...
    > Yes, but how can I do it for just cells A through O? I find "Totals" on row
    > 100 and then want cells adjust the borders for cells A:O for just that row. ?
    > ????
    >
    > Ron de Bruin wrote:
    >>You select the row with your code so if you record a macro you can add this to your code
    >>
    >>Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
    >> , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    >> MatchCase:=False, SearchFormat:=False).EntireRow.Activate
    >>
    >> Selection.Borders(xlEdgeLeft).LineStyle = xlContinuous
    >> Selection.Borders(xlEdgeTop).LineStyle = xlContinuous
    >> Selection.Borders(xlEdgeBottom).LineStyle = xlContinuous
    >> Selection.Borders(xlEdgeRight).LineStyle = xlContinuous
    >>
    >>> You must not have understood my question. I want to be able to set up the
    >>> borders for cells A:O on the row that the "find" found what I was looking for.

    >>[quoted text clipped - 9 lines]
    >>>>>
    >>>>> I try to set up the borders for that entire row but it is not working. Help?

    >
    > --
    > Message posted via http://www.officekb.com




  8. #8
    erikkeith via OfficeKB.com
    Guest

    Re: Border help

    Thanks! That worked

    Ron de Bruin wrote:
    >Sub test()
    > Dim rng As Range
    >
    > Set rng = Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
    > , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    > MatchCase:=False, SearchFormat:=False)
    >
    > If Not rng Is Nothing Then
    > With rng.Resize(1, 15)
    > .Borders(xlEdgeLeft).LineStyle = xlContinuous
    > .Borders(xlEdgeTop).LineStyle = xlContinuous
    > .Borders(xlEdgeBottom).LineStyle = xlContinuous
    > .Borders(xlEdgeRight).LineStyle = xlContinuous
    > End With
    > Else
    > MsgBox "Nothing found"
    > End If
    >
    >End Sub
    >
    >> Yes, but how can I do it for just cells A through O? I find "Totals" on row
    >> 100 and then want cells adjust the borders for cells A:O for just that row. ?

    >[quoted text clipped - 16 lines]
    >>>>>>
    >>>>>> I try to set up the borders for that entire row but it is not working. Help?


    --
    Message posted via http://www.officekb.com

  9. #9
    Ron de Bruin
    Guest

    Re: Border help

    Change cells.find to Columns("A").find to be sure it only look in A

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "erikkeith via OfficeKB.com" <u13156@uwe> wrote in message news:5fe49d45e96e9@uwe...
    > Thanks! That worked
    >
    > Ron de Bruin wrote:
    >>Sub test()
    >> Dim rng As Range
    >>
    >> Set rng = Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
    >> , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    >> MatchCase:=False, SearchFormat:=False)
    >>
    >> If Not rng Is Nothing Then
    >> With rng.Resize(1, 15)
    >> .Borders(xlEdgeLeft).LineStyle = xlContinuous
    >> .Borders(xlEdgeTop).LineStyle = xlContinuous
    >> .Borders(xlEdgeBottom).LineStyle = xlContinuous
    >> .Borders(xlEdgeRight).LineStyle = xlContinuous
    >> End With
    >> Else
    >> MsgBox "Nothing found"
    >> End If
    >>
    >>End Sub
    >>
    >>> Yes, but how can I do it for just cells A through O? I find "Totals" on row
    >>> 100 and then want cells adjust the borders for cells A:O for just that row. ?

    >>[quoted text clipped - 16 lines]
    >>>>>>>
    >>>>>>> I try to set up the borders for that entire row but it is not working. Help?

    >
    > --
    > Message posted via http://www.officekb.com




+ 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