+ Reply to Thread
Results 1 to 5 of 5

highlight with right click?

  1. #1
    Newbie
    Guest

    highlight with right click?

    is there a simple way to color a cell with a right click (excel2003) ?

  2. #2
    Norman Jones
    Guest

    Re: highlight with right click?

    Hi Newbie,

    Perhaps a the response to a double click would meet your needs?

    Try:

    '=============>>
    Private Sub Worksheet_BeforeDoubleClick _
    (ByVal Target As Range, Cancel As Boolean)
    Target.Interior.ColorIndex = 6 '<<== CHANGE
    End Sub
    '<<=============

    This is worksheet event code and should be pasted into the worksheets's code
    module (not a standard module and not the workbook's ThisWorkbook module):

    Right-click the worksheet's tab
    Select 'View Code' from the menu and paste the code.
    Alt-F11 to return to Excel.


    ---
    Regards,
    Norman


    "Newbie" <[email protected]> wrote in message
    news:[email protected]...
    > is there a simple way to color a cell with a right click (excel2003) ?




  3. #3
    Newbie
    Guest

    Re: highlight with right click?

    works like a dream. Thank you Norman.

    "Norman Jones" wrote:

    > Hi Newbie,
    >
    > Perhaps a the response to a double click would meet your needs?
    >
    > Try:
    >
    > '=============>>
    > Private Sub Worksheet_BeforeDoubleClick _
    > (ByVal Target As Range, Cancel As Boolean)
    > Target.Interior.ColorIndex = 6 '<<== CHANGE
    > End Sub
    > '<<=============
    >
    > This is worksheet event code and should be pasted into the worksheets's code
    > module (not a standard module and not the workbook's ThisWorkbook module):
    >
    > Right-click the worksheet's tab
    > Select 'View Code' from the menu and paste the code.
    > Alt-F11 to return to Excel.
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "Newbie" <[email protected]> wrote in message
    > news:[email protected]...
    > > is there a simple way to color a cell with a right click (excel2003) ?

    >
    >
    >


  4. #4
    Jim May
    Guest

    Re: highlight with right click?

    Norman:
    Seeing this reminds me (daaa) - seems like a double-click caused excel to
    think you wished to Edit a cell and thereby a Cancel = True line needed to be
    entered -- before proceeding with the code. Can you clarify my confusion?

    Thanks always for you great contribution to these NG's..

    Jim May

    "Norman Jones" wrote:

    > Hi Newbie,
    >
    > Perhaps a the response to a double click would meet your needs?
    >
    > Try:
    >
    > '=============>>
    > Private Sub Worksheet_BeforeDoubleClick _
    > (ByVal Target As Range, Cancel As Boolean)
    > Target.Interior.ColorIndex = 6 '<<== CHANGE
    > End Sub
    > '<<=============
    >
    > This is worksheet event code and should be pasted into the worksheets's code
    > module (not a standard module and not the workbook's ThisWorkbook module):
    >
    > Right-click the worksheet's tab
    > Select 'View Code' from the menu and paste the code.
    > Alt-F11 to return to Excel.
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "Newbie" <[email protected]> wrote in message
    > news:[email protected]...
    > > is there a simple way to color a cell with a right click (excel2003) ?

    >
    >
    >


  5. #5
    Norman Jones
    Guest

    Re: highlight with right click?

    Hi Jim,

    You are quite correct!

    Amending, therefore the code:

    '=============>>
    Private Sub Worksheet_BeforeDoubleClick _
    (ByVal Target As Range, Cancel As Boolean)
    Cancel = True
    Target.Interior.ColorIndex = 6
    End Sub
    '<<=============

    Thanks for the remonder!

    --
    Regards,
    Norman



    "Jim May" <[email protected]> wrote in message
    news:[email protected]...
    > Norman:
    > Seeing this reminds me (daaa) - seems like a double-click caused excel to
    > think you wished to Edit a cell and thereby a Cancel = True line needed to
    > be
    > entered -- before proceeding with the code. Can you clarify my confusion?
    >
    > Thanks always for you great contribution to these NG's..
    >
    > Jim May
    >
    > "Norman Jones" wrote:
    >
    >> Hi Newbie,
    >>
    >> Perhaps a the response to a double click would meet your needs?
    >>
    >> Try:
    >>
    >> '=============>>
    >> Private Sub Worksheet_BeforeDoubleClick _
    >> (ByVal Target As Range, Cancel As Boolean)
    >> Target.Interior.ColorIndex = 6 '<<== CHANGE
    >> End Sub
    >> '<<=============
    >>
    >> This is worksheet event code and should be pasted into the worksheets's
    >> code
    >> module (not a standard module and not the workbook's ThisWorkbook
    >> module):
    >>
    >> Right-click the worksheet's tab
    >> Select 'View Code' from the menu and paste the code.
    >> Alt-F11 to return to Excel.
    >>
    >>
    >> ---
    >> Regards,
    >> Norman
    >>
    >>
    >> "Newbie" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > is there a simple way to color a cell with a right click (excel2003) ?

    >>
    >>
    >>




+ 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