Coloring a range, passing the mouse

elsg

Active Member
Joined
Mar 16, 2013
Messages
295
Hi.
I wonder if it is possible to color the background of nonblank cells in a range, passing the mouse (maybe MouseMove Event)
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
1. select the range
2. push alt, o , d
3. use formula
4. copy and past this =not(a1="") this is assuming that your range starts in a1 if not adjust accordingly
 
Upvote 0
not conditional formatting!!


Hovering the mouse over the range that has data cells that range will be colored
 
Upvote 0
try below code in Worksheet Module ( Right Click on Sheet Tab Then View Code And paste below code close)
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlNone
For Each cell In Selection
If cell.Value <> "" Then cell.Interior.ColorIndex = 6
Next
End Sub
 
Upvote 0
Thanks, but not that.


In your code I have to do click in the cell.


What I want is: when you move the mouse over the cell
 
Upvote 0
Thanks, but not that.


In your code I have to do click in the cell.



What I want is: when you move the mouse over the cell

Without click no cell how can you select range ?
 
Upvote 0
I do not want to select anything, I want to move the mouse (pass mouser), the cell
 
Upvote 0
sorry this beyond my ability some other can help may be thanks
 
Upvote 0
while someone does not respond, then how do I use your code differently.


one that was clicked, the range will be colored.
 
Upvote 0

Forum statistics

Threads
1,214,972
Messages
6,122,530
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top