Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
mouse click or mouseover and get color
Good evening. Please help me to edit this macro code. Sub Macro1() With Selection.Interior ColorIndex = 6 Pattern = xlSolid End With Range("G1").Select With Selection.Interior ColorIndex = 6 Pattern = xlSolid End With End Sub The problem is I would like to click mouse to highlight the cell. And I want this code to do some picture on stand cheer with my students in sport day. I don't want to click the color plate and click on cell. I just want one click. For example I select the yellow and then I click mouse on any cell to make heart shaped such as j1 k1 j2 k2,...... Thank you. -- sakijung ------------------------------------------------------------------------ sakijung's Profile: http://www.excelforum.com/member.php...fo&userid=4797 View this thread: http://www.excelforum.com/showthread...hreadid=319021 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
mouse click or mouseover and get color
There is no SingleClick event for a worksheet.
There is an event called SelectionChange, but for your request I believe you would find this more troublesome than it's worth. How about DoubleClick? Here's how: Right-click the sheet tab, select View Code. Paste this code: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) With Target.Interior .ColorIndex = IIf(.ColorIndex < 6, 6, xlColorIndexNone) End With Cancel = True End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "sakijung" wrote in message ... Good evening. Please help me to edit this macro code. Sub Macro1() With Selection.Interior ColorIndex = 6 Pattern = xlSolid End With Range("G1").Select With Selection.Interior ColorIndex = 6 Pattern = xlSolid End With End Sub The problem is I would like to click mouse to highlight the cell. And I want this code to do some picture on stand cheer with my students in sport day. I don't want to click the color plate and click on cell. I just want one click. For example I select the yellow and then I click mouse on any cell to make heart shaped such as j1 k1 j2 k2,...... Thank you. -- sakijung ------------------------------------------------------------------------ sakijung's Profile: http://www.excelforum.com/member.php...fo&userid=4797 View this thread: http://www.excelforum.com/showthread...hreadid=319021 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
mouse click or mouseover and get color
Kob-Kun-Krub (Thank you in English) The code that you tell is extremely excellent. Thank you again. -- sakijung ------------------------------------------------------------------------ sakijung's Profile: http://www.excelforum.com/member.php...fo&userid=4797 View this thread: http://www.excelforum.com/showthread...hreadid=319021 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Right Mouse Click | Excel Discussion (Misc queries) | |||
right click on the mouse does not work | Excel Discussion (Misc queries) | |||
Crash on mouse click | Excel Discussion (Misc queries) | |||
Run Macro on Mouse Click | Excel Worksheet Functions | |||
Each Click of the Mouse | Excel Discussion (Misc queries) |