[COLOR=#333333]Private Sub Worksheet_calculate()[/COLOR]
[COLOR=#333333] If Range("K23").Value > 500 And [/COLOR][COLOR=#ff0000]Range[/COLOR][COLOR=#333333]("E23") = "KIT" Then[/COLOR]
[COLOR=#333333] MsgBox "this is a test"
End If
End Sub[/COLOR]
Yes thus works. So now I want to use the below code to work with a range of cells, not just one. For example, I want the warning to work for cell "C23" down to the last cell with data. If it matters, we populate the first row with data and then copy the first row down let's say 20 rows and then we modify the data in those rows.
Private Sub Worksheet_calculate()
If Range("C23").Value = "SL10" Then MsgBox "USE CONTINUOUS CHAIN"
End Sub
Private Sub Worksheet_calculate()
Dim c As Range
For Each c In Range("C23:C" & Cells(Rows.Count, 3).End(3).Row)
If c.Value = "SL10" Then MsgBox "USE CONTINUOUS CHAIN" & " at " & c.Address(0, 0)
Next c
End Sub
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.