Hi everybody!
I have columns of data that are generated by formulae inserted by the following code.
Private Sub XtendData()
Dim w As Integer
‘Insert formulae in Col 22
For w = 12 To 200 Step 2
Cells(w, 22).FormulaR1C1 = "=IF(OR(RC[-14]="""", RC[-8] = """"), """", IF(RC[-14] = R8C22, RC[-8], """"))"
Next
‘Insert formulae in Col 23
For w = 12 To 200 Step 2
Cells(w, 23).FormulaR1C1 = "=IF(OR(RC[-15]="""", RC[-9] = """"), """", IF(RC[-15] = R8C23, RC[-9], """"))"
Next
‘Insert formulae in Col 24
For w = 12 To 200 Step 2
Cells(w, b).FormulaR1C1 = "=IF(OR(RC[-16]="""", RC[-10] = """"), """", IF(RC[-16] = R8C24, RC[-10], """"))"
Next
And so on ad infinitum for 25 columns. I know there must be a more efficient way to write this but I can’t figure it out. Can anybody help please as I am facing the prospect of even more columns!
Thanks in advance!
I have columns of data that are generated by formulae inserted by the following code.
Private Sub XtendData()
Dim w As Integer
‘Insert formulae in Col 22
For w = 12 To 200 Step 2
Cells(w, 22).FormulaR1C1 = "=IF(OR(RC[-14]="""", RC[-8] = """"), """", IF(RC[-14] = R8C22, RC[-8], """"))"
Next
‘Insert formulae in Col 23
For w = 12 To 200 Step 2
Cells(w, 23).FormulaR1C1 = "=IF(OR(RC[-15]="""", RC[-9] = """"), """", IF(RC[-15] = R8C23, RC[-9], """"))"
Next
‘Insert formulae in Col 24
For w = 12 To 200 Step 2
Cells(w, b).FormulaR1C1 = "=IF(OR(RC[-16]="""", RC[-10] = """"), """", IF(RC[-16] = R8C24, RC[-10], """"))"
Next
And so on ad infinitum for 25 columns. I know there must be a more efficient way to write this but I can’t figure it out. Can anybody help please as I am facing the prospect of even more columns!
Thanks in advance!