I want to repeat this code on all the worksheets in a workbook.
There may sometimes be 1-2 worksheets sometimes 50+.
Sub HoursTotal()
\'
\' HoursTota
You need to activate the worksheet so that excel can make changes to it.
`Sub HoursTotal() Dim ws As Worksheet
For Each ws In Worksheets
ws.Activate
ws.Range("F2").FormulaR1C1 = "=SUM(C[-1])"
ws.Range("F1").FormulaR1C1 = "Total Hours"
ws.Range("G1").Select 'I don't think you need this line but I included it anyways
Next
End Sub`