How to re-calculate sheet on change in Format of a cell

Juggler_IN

Active Member
Joined
Nov 19, 2014
Messages
358
Office Version
  1. 2003 or older
Platform
  1. Windows
I want the re-calculate sheet (F9) when there is change in format --- from bold to un-bold and vice versa in Range ("A4:A65536").

I have a tiger code for change in cell values. How can we add the BOLD/UNBOLD aspect?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will cause an alert
' when they are changed.
Set KeyCells = Range("A4:A65536")
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
' Display a message when one of the designated cells has been changed.
MsgBox "Cell " & Target.Address & " has changed."
Calculate
End If
End Sub
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Changing the format of a cell does not change the value.
So why would there be a need for a recalculation?
And why not just have your sheet on AutoCalc?
 
Upvote 0
There mathematical operations on Cells which are BOLD. If I make a cell BOLD it gets considered for calculation else not.
 
Upvote 0
Is there a reason why you do not want AutoCalc on?

Here is a link here that shows you how you can just calculate selected cells: https://www.extendoffice.com/documents/excel/3931-excel-only-recalculate-refresh-selected-cells.html

Do do what you want, the only way I can think of is to create a macro that loops through your specified range, and check each cell to see if if is bold, and if it is, then recalc that cell.
That is pretty slow and inefficient, so I would probably recommend running/calling that macro manually, so it doesn't run needlessly and slow your sheet down to the point where it is hard to work with.
 
Upvote 0
Just changing the font of a cell will not change if it is a calculable formula or not - hmm unless you are applying bold to cells that would be used IN the formula? If that is the case, it might be quicker to add a helper cell with an X (or something) to indicate it is to be used (or not used)
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

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