Locking formulas in a set of cells

justp90

New Member
Joined
Dec 17, 2012
Messages
5
I need to know how i can lock formulas in certain columns. As of right now I have the code below to list things through an input box. In columns E9:E30,F9:F30,J9:J30, and K9;K30 I have a formula than needs to me locked. Is there anyway I can write in my code to lock it without a password?
Sub Energy()
Dim dblRow As Double, dtDate As Date, strProject As String
Dim strFalut As String, strProb As String, strSol As String
dblRow = InputBox("What Row to Enter On")
dtDate = InputBox("Date", , Date)
strTempIn = InputBox("Temp In")
strTempOut = InputBox("Temp Out")
strGPM = InputBox("GPM")
strAmp = InputBox("Amps")
strVolt = InputBox("Volts")
strPf = InputBox("PF")
Range("A" & dblRow).Value = dtDate
Range("B" & dblRow).Value = strTempIn
Range("C" & dblRow).Value = strTempOut
Range("D" & dblRow).Value = strGPM
Range("G" & dblRow).Value = strAmp
Range("H" & dblRow).Value = strVolt
Range("I" & dblRow).Value = strPf

End Sub
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,214,965
Messages
6,122,495
Members
449,088
Latest member
Melvetica

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