+ Reply to Thread
Results 1 to 6 of 6

Select the entire row

  1. #1
    shantanu oak
    Guest

    Select the entire row

    I want to select the entire row and change the color of the row where
    the word "CASH" is in a single cell.

    The following code of the macro is not working.

    '
    Selection.FormatConditions.Delete
    Selection.FormatConditions.Add Type:=xlCellValue,
    Operator:=xlEqual, _
    Formula1:="=""CASH"""
    Rows(FormatConditions(1)).Select
    Selection.Font.ColorIndex = 45


    Please guide.


  2. #2
    Bob Phillips
    Guest

    Re: Select the entire row

    Selection.FormatConditions.Delete
    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
    Formula1:="CASH"
    Selection.FormatConditions(1).Font.ColorIndex = 345


    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "shantanu oak" <[email protected]> wrote in message
    news:[email protected]...
    > I want to select the entire row and change the color of the row where
    > the word "CASH" is in a single cell.
    >
    > The following code of the macro is not working.
    >
    > '
    > Selection.FormatConditions.Delete
    > Selection.FormatConditions.Add Type:=xlCellValue,
    > Operator:=xlEqual, _
    > Formula1:="=""CASH"""
    > Rows(FormatConditions(1)).Select
    > Selection.Font.ColorIndex = 45
    >
    >
    > Please guide.
    >




  3. #3
    shantanu oak
    Guest

    Re: Select the entire row

    Hi,
    I want to highlight the entire row in which the word cash appears.

    Shantanu

    Bob Phillips wrote:
    > Selection.FormatConditions.Delete
    > Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
    > Formula1:="CASH"
    > Selection.FormatConditions(1).Font.ColorIndex = 345
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (replace somewhere in email address with gmail if mailing direct)
    >
    > "shantanu oak" <[email protected]> wrote in message
    > news:[email protected]...
    > > I want to select the entire row and change the color of the row where
    > > the word "CASH" is in a single cell.
    > >
    > > The following code of the macro is not working.
    > >
    > > '
    > > Selection.FormatConditions.Delete
    > > Selection.FormatConditions.Add Type:=xlCellValue,
    > > Operator:=xlEqual, _
    > > Formula1:="=""CASH"""
    > > Rows(FormatConditions(1)).Select
    > > Selection.Font.ColorIndex = 45
    > >
    > >
    > > Please guide.
    > >



  4. #4
    Bob Phillips
    Guest

    Re: Select the entire row

    With Selection.EntireRow
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, _
    Formula1:="=" & ActiveCell.Address(False,
    True) & "=""CASH"""
    .FormatConditions(1).Font.ColorIndex = 45
    End With



    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "shantanu oak" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    > I want to highlight the entire row in which the word cash appears.
    >
    > Shantanu
    >
    > Bob Phillips wrote:
    > > Selection.FormatConditions.Delete
    > > Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual,

    _
    > > Formula1:="CASH"
    > > Selection.FormatConditions(1).Font.ColorIndex = 345
    > >
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (replace somewhere in email address with gmail if mailing direct)
    > >
    > > "shantanu oak" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I want to select the entire row and change the color of the row where
    > > > the word "CASH" is in a single cell.
    > > >
    > > > The following code of the macro is not working.
    > > >
    > > > '
    > > > Selection.FormatConditions.Delete
    > > > Selection.FormatConditions.Add Type:=xlCellValue,
    > > > Operator:=xlEqual, _
    > > > Formula1:="=""CASH"""
    > > > Rows(FormatConditions(1)).Select
    > > > Selection.Font.ColorIndex = 45
    > > >
    > > >
    > > > Please guide.
    > > >

    >




  5. #5
    shantanu oak
    Guest

    Re: Select the entire row

    Thanks.
    Now I want to color alternate rows using conditional formatting and I
    can do it manually by using this formulae...
    =ODD(ROW())=ROW()

    How do I add it in a macro?


    Bob Phillips wrote:
    > With Selection.EntireRow
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, _
    > Formula1:="=" & ActiveCell.Address(False,
    > True) & "=""CASH"""
    > .FormatConditions(1).Font.ColorIndex = 45
    > End With
    >
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (replace somewhere in email address with gmail if mailing direct)
    >
    > "shantanu oak" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi,
    > > I want to highlight the entire row in which the word cash appears.
    > >
    > > Shantanu
    > >
    > > Bob Phillips wrote:
    > > > Selection.FormatConditions.Delete
    > > > Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual,

    > _
    > > > Formula1:="CASH"
    > > > Selection.FormatConditions(1).Font.ColorIndex = 345
    > > >
    > > >
    > > > --
    > > > HTH
    > > >
    > > > Bob Phillips
    > > >
    > > > (replace somewhere in email address with gmail if mailing direct)
    > > >
    > > > "shantanu oak" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > I want to select the entire row and change the color of the row where
    > > > > the word "CASH" is in a single cell.
    > > > >
    > > > > The following code of the macro is not working.
    > > > >
    > > > > '
    > > > > Selection.FormatConditions.Delete
    > > > > Selection.FormatConditions.Add Type:=xlCellValue,
    > > > > Operator:=xlEqual, _
    > > > > Formula1:="=""CASH"""
    > > > > Rows(FormatConditions(1)).Select
    > > > > Selection.Font.ColorIndex = 45
    > > > >
    > > > >
    > > > > Please guide.
    > > > >

    > >



  6. #6
    Bob Phillips
    Guest

    Re: Select the entire row

    With Selection.EntireRow
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, _
    Formula1:="=ODD(ROW())=ROW()"
    .FormatConditions(1).Font.ColorIndex = 45
    End With


    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "shantanu oak" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks.
    > Now I want to color alternate rows using conditional formatting and I
    > can do it manually by using this formulae...
    > =ODD(ROW())=ROW()
    >
    > How do I add it in a macro?
    >
    >
    > Bob Phillips wrote:
    > > With Selection.EntireRow
    > > .FormatConditions.Delete
    > > .FormatConditions.Add Type:=xlExpression, _
    > > Formula1:="=" & ActiveCell.Address(False,
    > > True) & "=""CASH"""
    > > .FormatConditions(1).Font.ColorIndex = 45
    > > End With
    > >
    > >
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (replace somewhere in email address with gmail if mailing direct)
    > >
    > > "shantanu oak" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi,
    > > > I want to highlight the entire row in which the word cash appears.
    > > >
    > > > Shantanu
    > > >
    > > > Bob Phillips wrote:
    > > > > Selection.FormatConditions.Delete
    > > > > Selection.FormatConditions.Add Type:=xlCellValue,

    Operator:=xlEqual,
    > > _
    > > > > Formula1:="CASH"
    > > > > Selection.FormatConditions(1).Font.ColorIndex = 345
    > > > >
    > > > >
    > > > > --
    > > > > HTH
    > > > >
    > > > > Bob Phillips
    > > > >
    > > > > (replace somewhere in email address with gmail if mailing direct)
    > > > >
    > > > > "shantanu oak" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > I want to select the entire row and change the color of the row

    where
    > > > > > the word "CASH" is in a single cell.
    > > > > >
    > > > > > The following code of the macro is not working.
    > > > > >
    > > > > > '
    > > > > > Selection.FormatConditions.Delete
    > > > > > Selection.FormatConditions.Add Type:=xlCellValue,
    > > > > > Operator:=xlEqual, _
    > > > > > Formula1:="=""CASH"""
    > > > > > Rows(FormatConditions(1)).Select
    > > > > > Selection.Font.ColorIndex = 45
    > > > > >
    > > > > >
    > > > > > Please guide.
    > > > > >
    > > >

    >




+ 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