+ Reply to Thread
Results 1 to 3 of 3

how would you change these....

Hybrid View

  1. #1
    Gary Keramidas
    Guest

    how would you change these....

    to work without using select? i know a lot of you say not to use it.

    Range("J8:O27").Select
    Selection.Font.Bold = False
    Range("I8").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown).Offset(-1, 0)).Select

    Selection.FormatConditions.Delete
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
    "=MOD(ROW(),2)=1"
    With Selection.FormatConditions(1).Borders(xlLeft)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
    End With
    With Selection.FormatConditions(1).Borders(xlRight)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
    End With
    With Selection.FormatConditions(1).Borders(xlTop)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
    End With
    With Selection.FormatConditions(1).Borders(xlBottom)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
    End With
    Selection.FormatConditions(1).Interior.ColorIndex = 37

    --


    Gary




  2. #2
    Tim Williams
    Guest

    Re: how would you change these....

    Dim rng As Range

    Range("J8:O27").Font.Bold = False

    Set rng = Range(Range("I8"),
    Range("I8").End(xlToRight).End(xlDown).Offset(-1, 0))

    With rng

    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:= _
    "=MOD(ROW(),2)=1"

    With .FormatConditions(1).Borders
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
    End With
    .FormatConditions(1).Interior.ColorIndex = 37
    End With

    Tim




    "Gary Keramidas" <[email protected]> wrote in message
    news:[email protected]...
    > to work without using select? i know a lot of you say not to use it.
    >
    > > Select

    > Range(Selection, Selection.End(xlToRight)).Select
    > Range(Selection, Selection.End(xlDown).Offset(-1, 0)).Select
    >
    > Selection.FormatConditions.Delete
    > Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
    > "=MOD(ROW(),2)=1"
    > With Selection.FormatConditions(1).Borders(xlLeft)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = xlAutomatic
    > End With
    > With Selection.FormatConditions(1).Borders(xlRight)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = xlAutomatic
    > End With
    > With Selection.FormatConditions(1).Borders(xlTop)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = xlAutomatic
    > End With
    > With Selection.FormatConditions(1).Borders(xlBottom)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = xlAutomatic
    > End With
    > Selection.FormatConditions(1).Interior.ColorIndex = 37
    >
    > --
    >
    >
    > Gary
    >
    >
    >




  3. #3
    Gary Keramidas
    Guest

    Re: how would you change these....

    thanks tim

    --


    Gary


    "Tim Williams" <saxifrax@pacbell*dot*net> wrote in message
    news:[email protected]...
    > Dim rng As Range
    >
    > Range("J8:O27").Font.Bold = False
    >
    > Set rng = Range(Range("I8"),
    > Range("I8").End(xlToRight).End(xlDown).Offset(-1, 0))
    >
    > With rng
    >
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:= _
    > "=MOD(ROW(),2)=1"
    >
    > With .FormatConditions(1).Borders
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = xlAutomatic
    > End With
    > .FormatConditions(1).Interior.ColorIndex = 37
    > End With
    >
    > Tim
    >
    >
    >
    >
    > "Gary Keramidas" <[email protected]> wrote in message
    > news:[email protected]...
    >> to work without using select? i know a lot of you say not to use it.
    >>
    >> > Select

    >> Range(Selection, Selection.End(xlToRight)).Select
    >> Range(Selection, Selection.End(xlDown).Offset(-1, 0)).Select
    >>
    >> Selection.FormatConditions.Delete
    >> Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
    >> "=MOD(ROW(),2)=1"
    >> With Selection.FormatConditions(1).Borders(xlLeft)
    >> .LineStyle = xlContinuous
    >> .Weight = xlThin
    >> .ColorIndex = xlAutomatic
    >> End With
    >> With Selection.FormatConditions(1).Borders(xlRight)
    >> .LineStyle = xlContinuous
    >> .Weight = xlThin
    >> .ColorIndex = xlAutomatic
    >> End With
    >> With Selection.FormatConditions(1).Borders(xlTop)
    >> .LineStyle = xlContinuous
    >> .Weight = xlThin
    >> .ColorIndex = xlAutomatic
    >> End With
    >> With Selection.FormatConditions(1).Borders(xlBottom)
    >> .LineStyle = xlContinuous
    >> .Weight = xlThin
    >> .ColorIndex = xlAutomatic
    >> End With
    >> Selection.FormatConditions(1).Interior.ColorIndex = 37
    >>
    >> --
    >>
    >>
    >> Gary
    >>
    >>
    >>

    >
    >




+ 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