Well, I'd create another worksheet named "vocabulary". It'd looked like this:
[TABLE="class: grid, width: 256"]
<tbody>[TR]
[TD]columns to copy formula[/TD]
[TD]last row in range you want to copy formula to[/TD]
[/TR]
[TR]
[TD="align: right"]27[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]30[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]38[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]39[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]47[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]48[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]50[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]52[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]53[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]54[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]61[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]72[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]74[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]75[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]76[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]77[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]78[/TD]
[TD="align: right"]1000[/TD]
[/TR]
[TR]
[TD="align: right"]79[/TD]
[TD="align: right"]1000[/TD]
[/TR]
</tbody>[/TABLE]
Then I'd used this code:
Code:
Sub pvman()
Dim lr As Integer
Dim ws As Worksheet
Dim vc As Worksheet
'assign main sheet to variable
Set ws = Sheets("sheet1")
'assing vocabulary sheet to variable
Set vc = Sheets("vocabulary")
'check how many rows with column number should we check in vocabulary
With vc
lr = .Range("A" & .Rows.Count).End(xlUp).Row
End With
'iterate through all column addresses from vc
For i = 2 To lr
'use column numbers in formula copy in main sheet
With ws
.Cells(1, vc.Cells(i, 1)).Copy
.Range(.Cells(3, vc.Cells(i, 1)).Address & ":" & .Cells(vc.Cells(i, 2), vc.Cells(i, 1)).Address).PasteSpecial xlPasteFormulas
End With
Next i
End Sub
Replace sheet1 with the name of a worksheet with formulas to copy.
In vocabulary sheets, column A you can type number of all columns you want to use for formula copy.
Column B keeps info of last rows in range you want to copy a formula to. For each column you can specify different row number.
Nothing fancy, but I hope it does the trick.