Cartwheels
09-22-2009, 01:41 PM
I need to add on to my macro to repopulate the formula in range E9-E50. This macro is used for payroll. Users need to change the rate of pay on column E, then I have to manually fix the formula. I am hoping someone can help me make it a little more automatic. I attached a sample of the workbook.
Sub Clear()
'
' Clear Macro
'
'
'
'Clear
Dim i As Long
For i = 2 To Worksheets.Count
With Worksheets(i)
.Unprotect
.Range("A5") = "999999"
.Range("A9:d50").ClearContents
.Range("E6:K6") = "1"
'I need to re-populate the formula in range("E9:E50") here
.Range("E1:iv50").Interior.ColorIndex = 15
.Protect
.Range("A9") = "1"
End With
Next i
Sheets("Entry 1").Select
Range("A5").Select
End Sub
Sub Clear()
'
' Clear Macro
'
'
'
'Clear
Dim i As Long
For i = 2 To Worksheets.Count
With Worksheets(i)
.Unprotect
.Range("A5") = "999999"
.Range("A9:d50").ClearContents
.Range("E6:K6") = "1"
'I need to re-populate the formula in range("E9:E50") here
.Range("E1:iv50").Interior.ColorIndex = 15
.Protect
.Range("A9") = "1"
End With
Next i
Sheets("Entry 1").Select
Range("A5").Select
End Sub