Here is the original excel code (from 1 cell) this was copied across multiple rows and columns.
Here is the vba code I have so far but I am having issues making them relative to move and fill in the data.
Excel Formula:
=IF(ISERROR(XLOOKUP('Instructions and Setup'!F3,'USATP Gradebook'!$5:$5,'USATP Gradebook'!6:6,,2)),"",IF(ISBLANK(XLOOKUP('Instructions and Setup'!F3,'USATP Gradebook'!$5:$5,'USATP Gradebook'!6:6,,2)),"",XLOOKUP('Instructions and Setup'!F3,'USATP Gradebook'!$5:$5,'USATP Gradebook'!6:6,,2)/(100/'Instructions and Setup'!E3)))
Here is the vba code I have so far but I am having issues making them relative to move and fill in the data.
VBA Code:
Dim i As Integer, j As Integer, ilast As Integer, jlast As Integer
Sheets("USATP Gradebook").Select
jlast = Application.WorksheetFunction.CountIf(Range("A6:A705"), "<>") + 1 'The end point is variable
Sheets("Instructions and Setup").Select
ilast = Application.WorksheetFunction.CountIf(Range("G3:G53"), "<>") + 1 'The end point is variable
Sheets("Calculation").Visible = True
Sheets("Calculation").Select
For i = 1 To ilast
For j = 1 To jlast
Range("B5").Select 'Starting point would love to have in (j,i) format'
ActiveCell = "*" & ActiveWorkbook.Sheets("Instructions and Setup").Range("G3").Value & "*"
ActiveCell.Offset(2, 0).Select
ActiveCell.FormulaR1C1 = "=IF(ISERROR(XLOOKUP('Instructions and Setup'!R[-4]C[4],'USATP Gradebook'!R[-2],'USATP Gradebook'!R[-1],,2)),"""",IF(ISBLANK(XLOOKUP('Instructions and Setup'!R[-4]C[4],'USATP Gradebook'!R[-2],'USATP Gradebook'!R[-1],,2)),"""",XLOOKUP('Instructions and Setup'!R[-4]C[4],'USATP Gradebook'!R[-2],'USATP Gradebook'!R[-1],,2)/(100/'Instructions and Setup'!R[-4]C[3])))"
Next j
Next i