-
You could use arrays to store the corresponding numbers
[vba]Sub Nurofen()
Dim arr
arr1 = Array(5, 6, 7, 8, 9, 10)
arr2 = Array(13, 24, 26, 31, 33, 47)
For i = 0 To UBound(arr1)
Sheets("Test").Select
Range("D" & arr1(i)).FormulaR1C1 = "='Data'!R[" & arr2(i) & "]C[14]"
Next
End Sub
[/vba]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules