Conditional Format Selected Cell

Pacman52

Active Member
Joined
Jan 29, 2009
Messages
415
Office Version
  1. 365
Platform
  1. Windows
Just out of interest is it possible to format a cell when a user clicks in it to enter a value and once they move to the next relevant cell the formatting goes.

Basically, I designing a 'form' on a worksheet and want to highlight whatever cell the user clicks and is entering a value in, (so that its obvious what information is required in a particular cell).

I've already locked all the other cells.

Logically I'm thinking this must be achievable and if it is what would the CF formula be?

Thanks for any replies. Paul
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Wow that has to be the quickest response ever !!

Thanks so much, Joe I'll have a read through the link you provided.
 
Upvote 0
Ok so that sub obviously works the way it is intended to but it doesn't do what I'm after which is to highlight whatever cell a user has selected. I tried to play around with the code and adjust it, which sort of worked until I locked some cells.

I did a bit of a search online and came across this formula to use with conditional formatting which works although the CF only applies as soon as something has been typed in the a cell.

Excel Formula:
=AND(ROW()=CELL("row"),COLUMN()=CELL("col"))

Any ideas on anything I could change in the formula to make it work when a cell is actually selected?

Thanks Paul
 
Upvote 0
Solution
No, I do not know of any way to do it with Conditional Formatting. I don't know if it is possible.

Ok so that sub obviously works the way it is intended to but it doesn't do what I'm after which is to highlight whatever cell a user has selected
That code should do PRECISELY that, highlights whatever cell you select.

I tried to play around with the code and adjust it, which sort of worked until I locked some cells.
When you protect your sheet, check the option to allow them to change the format of cells, and it should work:
1730992558803.png
 
Upvote 0
Thanks so much for the replies and the tip on protecting a worksheet and a tick in Format Cells. I've never really noticed at all the options on this list but now you've highlighted it, I can see myself using some of them later.

The CF formula I posted earlier does actually do what I was trying to achieve now, I only had the issue whilst testing it on the actual sheet I was working on but as soon as I went to another sheet and then back to the 'test' sheet the CF formula worked perfectly.

Thanks again though for your help and advice.

Paul
 
Upvote 0
You are welcome.
Glad you were able to get something that works like you want!
 
Upvote 0
The CF formula I posted earlier does actually do what I was trying to achieve now, I only had the issue whilst testing it on the actual sheet I was working on but as soon as I went to another sheet and then back to the 'test' sheet the CF formula worked perfectly.
Are you saying that now if you click on various individual cells on that worksheet (without going to another worksheet in between) that the conditional formatting highlights each cell as you select it and removes the highlight from the previously selected cell? (That would not be normal behaviour unless something else is at play)

Do you have any vba at all in the workbook?
 
Upvote 0
Hi Peter sorry for not responding sooner, I just noticed the post.

I do have VBA in the actual workbook but nothing that relates to the CF. I basically just used and adapted a formula (as below) and it seems to work ok so far during testing.

To be honest this was only put into the worksheet as a visible 'guide' to the user to ensure they are entering the correct data into a specific cell, if you think it could cause problems later on I'm more that happy to remove it.

Excel Formula:
=AND(ROW()=CELL("row"),COLUMN()=CELL("col"))

I'd love to hear your thoughts on this.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,617
Latest member
Narendra Babu D

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