Conditional Format Selected Cell

Pacman52

Active Member
Joined
Jan 29, 2009
Messages
404
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
 
What Peter is saying is that should only update if there is an update to the calculation, which normally you would put some worksheet event code in the sheet or press F9
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
I do have VBA in the actual workbook but nothing that relates to the CF.
As @MARK858 has pointed out, the vba does not need to relate directly to the conditional formatting, it just needs to cause the screen to update to update the CF colouring. If you want to understand/demonstrate what I mean, try this.
  • Close all your existing open workbooks and start a fresh one
  • Apply your CF formula from post #5 to the whole active worksheet. The active cell (A1 if you have first selected the entire worksheet) should highlight.
  • Try selecting other cells on the sheet. You should find that the highlight does not update to the newly selected cells.
  • Now right click on the sheet's name tab and choose 'View Code' and enter this one-liner
    VBA Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range) 
      Application.ScreenUpdating = True
    End Sub
  • Try selecting other cells on the sheet again. This time the highlighting should update with each new selection.

if you think it could cause problems later on I'm more that happy to remove it.
I am not suggesting this will cause any problems. :)
 
Upvote 0
Thank you Mark and Peter,

I'm not 100% sure I'm understanding what you both mean but that's more than likely down to my inexperience.
I will try your suggestion Peter over the weekend, as I'm know you both know what your talking about Its just taking a bit of time for my brain to start working today !

I will post back the outcome though

Paul
 
Upvote 0

Forum statistics

Threads
1,223,702
Messages
6,173,961
Members
452,539
Latest member
delvey

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