Changing colour of selected cell

MrHibs

New Member
Joined
Sep 8, 2006
Messages
18
Hi guys,

Does anybody have a code that changes the colour of the cell you currently have selected?

So for example if you selected cell b3 that cell would now be green but if you selected b4, b3 would return to it's original colour and b4 would be highlighted green.

I'm also looking for a code that will do something similar but opposed to just changing the colour of the cell it will change the colour of the entire row that cell is in.

Cheers
 
This gets round the protected sheet problem, however the cells now stay that colour even after you click onto another cell, i.e. the cell doesn't revert to white after you've clicked off.

Any ideas?

Appreciate your help by the way.
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi,

I guess you might have missed to declare the global variables.

Add these global variables and try..

Code:
Dim i As Integer
Dim name1 As String


Its working fine for me..

Regards,
Abhiram
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,946
Members
449,480
Latest member
yesitisasport

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