run macro when cell C18 = 14

bptaw

Board Regular
Joined
Feb 27, 2017
Messages
69
Office Version
  1. 2016
Platform
  1. Windows
I have created 2 macros which create 2 textboxes with a unique message. I want to run macro1 when cell C18 = 14 and macro 2 when cell C18 <14. (Cell C18 sums entries from a range of cells)
Can anyone help? I also need a rest button to clear the cell entries.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Please show us your two Macro's
And you said:
which create 2 textboxes
Did you mean two Pop up Message Box's?

And you said:
I also need a rest button to clear the cell entries.

I believe all this could be done with just one script.

Show us your two macros or explain what your attempting to accomplish
Please give specific details.


 
Upvote 0
I wanted to insert a text box as this allows for formatting.
Macro1:

Sub Macro1()
'
' Macro1 Macro
'

'
Range("B20").Select
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 438.9130708661, _
352.1739370079, 262.1738582677, 112.1738582677).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = _
"In considering your scores, our experience suggests that you could have some developmental requirements in order to be successful with a 360 survey"
Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 147).ParagraphFormat _
.FirstLineIndent = 0
With Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 147).Font
.NameComplexScript = "+mn-cs"
.NameFarEast = "+mn-ea"
.Fill.Visible = msoTrue
.Fill.ForeColor.ObjectThemeColor = msoThemeColorDark1
.Fill.ForeColor.TintAndShade = 0
.Fill.ForeColor.Brightness = 0
.Fill.Transparency = 0
.Fill.Solid
.Size = 11
.Name = "+mn-lt"
End With
Selection.ShapeRange.ScaleHeight 0.6279067645, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleWidth 0.8507463942, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ShapeStyle = msoShapeStylePreset6
Selection.ShapeRange.TextFrame2.TextRange.Font.Bold = msoTrue
Range("A22").Select
End Sub
 
Last edited:
Upvote 0
So are you wanting this script to run as a sheet change event script?
And will be run when a change is made to C18

A sheet change event script can only be activated when a Manual change is made to a cell.
It looks like you want the script to run when a formula changes C18 value.

There is a sheet change event that can be done when a calculation is activated.
But I'm not sure how that works.

Maybe someone else here on the forum will be able to help you.
 
Upvote 0
So are you wanting this script to run as a sheet change event script?
And will be run when a change is made to C18

A sheet change event script can only be activated when a Manual change is made to a cell.
It looks like you want the script to run when a formula changes C18 value.

There is a sheet change event that can be done when a calculation is activated.
But I'm not sure how that works.

Maybe someone else here on the forum will be able to help you.


The cells update as the result of a formula.
 
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,227
Members
453,025
Latest member
Hannah_Pham93

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