Dim strpage As StringDim objpage As Object
Dim strrange As String
Dim objrange As Object
Dim wb As Object
Sub run_update()
UserForm1.Show
End Sub
Sub file_update(file_name As String)
Dim strformula As String
Dim count As Integer
ThisWorkbook.Sheets(1).Cells(5, 1).Select
count = 0
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
On Error GoTo traperror
Set wb = Workbooks.Open(Filename:=file_name, UpdateLinks:=0)
Do Until ThisWorkbook.Sheets(1).Cells(5, 1).Offset(count, 0).Value = ""
strpage = ThisWorkbook.Sheets(1).Cells(5, 1).Offset(count, 1)
strrange = ThisWorkbook.Sheets(1).Cells(5, 1).Offset(count, 2)
strformula = ThisWorkbook.Sheets(1).Cells(5, 1).Offset(count, 3)
Set objpage = wb.Sheets(strpage)
Set objrange = objpage.Range(strrange)
objpage.Unprotect Password:="BUDPASS"
objrange.Formula = strformula
objrange.Locked = False
objpage.Protect Password:="BUDPASS"
count = count + 1
Loop
With Application
.Calculation = xlCalculationAutomatic
.DisplayAlerts = False
With ActiveWorkbook
.Save
.Close
End With
.DisplayAlerts = True
End With
MsgBox count & " Formulas Successfully Updated!!"
Exit Sub
traperror:
MsgBox "Formulas Not All Updated!!! - " & count
End Sub
Dim strpage As String
Dim objpage As Object
Dim strrange As String
Dim objrange As Object
Dim wb As Object
Sub run_update()
UserForm1.Show
End Sub
Sub file_update(file_name As String)
Dim strformula As String
Dim count As Integer
ThisWorkbook.Sheets(1).Cells(5, 1).Select
count = 0
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
On Error GoTo traperror
Set wb = Workbooks.Open(Filename:=file_name, UpdateLinks:=0)
Do Until ThisWorkbook.Sheets(1).Cells(5, 1).Offset(count, 0).Value = ""
strpage = ThisWorkbook.Sheets(1).Cells(5, 1).Offset(count, 1)
strrange = ThisWorkbook.Sheets(1).Cells(5, 1).Offset(count, 2)
strformula = ThisWorkbook.Sheets(1).Cells(5, 1).Offset(count, 3)
Set objpage = wb.Sheets(strpage)
Set objrange = objpage.Range(strrange)
objpage.Unprotect Password:="BUDPASS"
objrange.Formula = strformula
[COLOR=#ff0000]objrange.Interior.ColorIndex = 6[/COLOR]
objrange.Locked = False
objpage.Protect Password:="BUDPASS"
count = count + 1
Loop
With Application
.Calculation = xlCalculationAutomatic
.DisplayAlerts = False
With ActiveWorkbook
.Save
.Close
End With
.DisplayAlerts = True
End With
MsgBox count & " Formulas Successfully Updated!!"
Exit Sub
traperror:
MsgBox "Formulas Not All Updated!!! - " & count
End Sub