So I am new to VBA and trying to write a piece of code to increase my efficiency. I am trying to iterate through 66 different sheets (named 1, 2, 3, etc.) and change the values of certain cells to reflect values listed in a summary sheet. I want to essentially iterate down by one row in the summary sheet for every sheet in the workbook. I tried to record a macro and write something based on that, but my solution doesn't work. Any help would be appreciated!
*Updated code, but something still isn't working. I think it may be because I am not properly selecting the sheet that I want to make the changes in?
**Edit2: The code works now- I guess I had to put the first 66 sheets at the beginning of the workbook, the macro was trying to iterate through other protected sheets. Thanks for the help.
Sub Macro6()
Dim WS_Count As Integer
Dim i As Integer
'Set WS_Count to the number of sheets with CPT data
WS_Count = 66
For i = 1 To WS_Count
Sheets(i).Activate
Sheets(i).Select
Range("A2").FormulaR1C1 = "='Data Input'!R[" & (17 + i) & "]C[1]"
Range("F6").FormulaR1C1 = "='Data Input'!R[" & (14 + i) & "]C[4]"
Range("H6").FormulaR1C1 = "='Data Input'!R[" & (14 + i) & "]C[3]"
Range("I6").FormulaR1C1 = "='Data Input'!R[" & (14 + i) & "]C[3]"
Range("L6").FormulaR1C1 = "='Data Input'!R[" & (14 + i) & "]C[8]"
Range("M6").FormulaR1C1 = "='Data Input'!R[" & (14 + i) & "]C[9]"
Next
End Sub