Change it to this:
ActiveCell.Formula = "=VLookup(""Total Other Operating Expenses"", " & _
sheetname & "!H:R, 7, True)"
Your current formula isn't computing ActiveWorkbook.Sheets(sheetname).Columns(""H:R"") because it's inside the string, so it tries to put that in the formula, but the VBA object model isn't accessible from a formula.
The fastest way I've found to remove large numbers of formulas is to select the column, copy it, and then paste it over itself using the Paste Values
function.
As far as preventing users from repeating this again, the only way I know would be to use the Protect Sheet and Protect Workbook features. Whether these can be adapted to your particular scenario would really depend on what you are trying to protect and what you still need to allow the users to do. Generally, however, you can limit the users to editing only certain ranges, columns or rows by locking all the other cells. There are options to allow users to still insert new rows, if desired. Unfortunately, I don't know of a way to lock the sheets so that users can enter data but can't add formulas.
You could use Data Validation to add an input message reminding the users not to enter formulas. It wouldn't stop them, but it would at least remind them constantly. Data Validation can also be used to force them to enter a specific data type, but it wouldn't stop a formula that provided the correct data type as its result.
UPDATE:
You can explicitly reject formulas in Excel by using the Worksheet_Change event, like so:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("C:C"), Range(Target.Address)) Is Nothing Then
If Range(Target.Address).HasFormula Then
Range(Target.Address).Value = ""
MsgBox "You may not enter formulas on this sheet!"
End If
End If
End Sub
In this example, the range checked for formulas is the entirety of column C. You could define any range you want to check, and then blank out the formula, change it to something else, warn the user, etc.
Best Answer
Thanks for the additional info. I am pretty sure this is what you are looking for; to turn off the AutoFill add the following before your code. To turn it back on, use the same line after your code with "True". Let me know if that did it.