Re: Each Click of the Mouse
- From: "Bob Phillips" <bob.phillips@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 22 Apr 2005 10:18:01 +0100
Try it and see :-).
What will happen is that each time you select a cell it will cycle through
the colours, as it picks up the current colour and works out the next from
this.
--
HTH
RP
(remove nothere from the email address if mailing direct)
"D.Parker" <DParker@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:96C20E60-78BD-44E1-B406-0F5B2BF83208@xxxxxxxxxxxxxxxx
> 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: D.Parker
- Re: Each Click of the Mouse
- References:
- Each Click of the Mouse
- From: D.Parker
- Re: Each Click of the Mouse
- From: Bob Phillips
- Re: Each Click of the Mouse
- From: D.Parker
- Each Click of the Mouse
- Prev by Date: Re: Work*** scroll area
- Next by Date: Excel Tabs
- Previous by thread: Re: Each Click of the Mouse
- Next by thread: Re: Each Click of the Mouse
- Index(es):
Loading