Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell color change with click and record the the time and date

How would I change the color of a block of cells with one click of the mouse
and then the next click a different color?

Example cells
on my excel 2003 page 7,8,9/DEF make a block. I need the first click in the
block to change the background green and record the Date/time somewhere else,
2nd click in the block the background will turn blue, time/date are recorded
( I will need them for later calculations) the 3rd could change it back to
white, make a cycle or RED and not change from red, to signal the other
time/date stamps are going to be inaccurate

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default cell color change with click and record the the time and date

In cell D7 insert a hyperlink to itself (don't use the hyperlink function).
Copy D7 and paste from D7 thru F9.

Click on any cell in the block and you will jump to D7

In the worksheet code area insert the following event macro:

Public clr As Variant
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Set r = Range("D7:F9")
If Target.SubAddress = "Sheet1!D7" Then
If IsEmpty(clr) Or clr = 5 Then
r.Interior.ColorIndex = 50
clr = 50
Else
r.Interior.ColorIndex = 5
clr = 5
End If
End If
End Sub

Clicking in the block will toggle back and forth between green and blue
--
Gary''s Student - gsnu200787


"Cyndyoxox" wrote:

How would I change the color of a block of cells with one click of the mouse
and then the next click a different color?

Example cells
on my excel 2003 page 7,8,9/DEF make a block. I need the first click in the
block to change the background green and record the Date/time somewhere else,
2nd click in the block the background will turn blue, time/date are recorded
( I will need them for later calculations) the 3rd could change it back to
white, make a cycle or RED and not change from red, to signal the other
time/date stamps are going to be inaccurate

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
on double click change cell color gaba Excel Programming 7 May 1st 08 03:37 PM
How can I get the system date & time for different cell record Get System Date & Time Excel Discussion (Misc queries) 8 January 9th 08 01:20 AM
Copying data from cell to other on click or color change Hassan Excel Programming 0 August 17th 07 02:20 AM
Change cell back color on click Dave Peterson Excel Discussion (Misc queries) 0 January 24th 05 10:50 PM
how do I: click in cell and make it change color? jasonsweeney Excel Programming 7 January 21st 04 09:17 PM


All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"