Re: Each Click of the Mouse
- From: "D.Parker" <DParker@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 21 Apr 2005 19:19:02 -0700
Thank you very much. If I reselect the cell at some other time will the past
color be retained, such that when a user clicks it will start from the last
know color in the case condition?
D.Parker
"Bob Phillips" wrote:
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> Static iCellColour As Long
> On Error GoTo ws_exit:
> Application.EnableEvents = False
> If Not Intersect(Target, Me.Range("A1:H10")) Is Nothing Then
> With Target
> Select Case .Interior.ColorIndex
> Case 3: .Interior.ColorIndex = 5
> Case 5: .Interior.ColorIndex = 6
> Case 6: .Interior.ColorIndex = 10
> Case Else: .Interior.ColorIndex = 3
> End Select
> End With
> Me.Range("A1").Select
> End If
>
> ws_exit:
> Application.EnableEvents = True
> End Sub
>
> 'This is work*** event code, which means that it needs to be
> 'placed in the appropriate work*** code module, not a standard
> 'code module. To do this, right-click on the *** tab, select
> 'the View Code option from the menu, and paste the code in.
>
>
> --
>
> HTH
>
> RP
> (remove nothere from the email address if mailing direct)
>
>
> "D.Parker" <DParker@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:9CA590A5-89E5-4675-94C1-150164A4F374@xxxxxxxxxxxxxxxx
> > Hello:
> >
> > Is there a way to change the ColorIndex of a given cell each time you
> > perform a left click with the mouse, within that same cell? I was going
> to
> > setup a loop(s) to cycle through the 4 colors red, blue, yellow, and green
> > and start the sequence over if the user continues to click. Thank you.
> >
> >
>
>
>
.
- Follow-Ups:
- Re: Each Click of the Mouse
- From: Bob Phillips
- Re: Each Click of the Mouse
- References:
- Each Click of the Mouse
- From: D.Parker
- Re: Each Click of the Mouse
- From: Bob Phillips
- Each Click of the Mouse
- Prev by Date: RE: Excel work***
- Next by Date: Re: Another Name question
- Previous by thread: Re: Each Click of the Mouse
- Next by thread: Re: Each Click of the Mouse
- Index(es):
Loading