Conditional Format Selected Cell

Pacman52

Active Member
Joined
Jan 29, 2009
Messages
426
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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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,224,746
Messages
6,180,705
Members
452,994
Latest member
Janick

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