Hi all,
Just wondering how the best way to make a formula using object orientated programming concerning VBA.
Just wanted to get this theory working, been looking at the PHP equivalent if you like and wondered if theres any way of doing a like minded approach to my macro's in Excel to make them speed up as it where.
Here's the test I have been working with:
[vba]
Dim testRange
Set testRange = Columns(2).Select
With testRange
.Formula = "=RC[-1]"
End With
testRange Nothing
[/vba]
Is there anyway of making it so if there's say 10 rows of data, in Column A, then only fill up the required rows in the 2nd column (Column B), using an object, then it sets that as nothing when completed.
Just wanted to try and speed up this macro a bit, as its crashing each time at the moment using this command here:
[vba]
Dim LastRowFirstRunOEM As String
LastRowFirstRunOEM = Cells(Rows.Count, "A").End(xlUp).Row
Range("B1").Resize(LastRowFirstRunOEM).Formula = "=vlookup($A1,'" & ThisWorkbook.Path & "\" & "dataSheet.xls'!xREF1,4,FALSE)"
[/vba]
Just wanted to create a more robust solution to this formula that I could possibly make into a more object orientated approach.
Thanks,
Jeremy.