When I use the following code:
Range("K1","K500".Select
Selection.Formula = sFormula
I have no problem. However, my application does not know where the data is going to end (i.e. the 500 will be variable) so I changed to this. Note that the data is in column A and the formula that acts on the data needs to go in column K:
sLastCell = "K" & Cstr(Range("A65536".End(xlUp).Row)
Range("K1",sLastCell).Select
Selection.Formula = sFormula
I get the following error when running this code:
"Method 'Range' of object '_Global' failed"
Does anybody know why this would be.
Range("K1","K500".Select
Selection.Formula = sFormula
I have no problem. However, my application does not know where the data is going to end (i.e. the 500 will be variable) so I changed to this. Note that the data is in column A and the formula that acts on the data needs to go in column K:
sLastCell = "K" & Cstr(Range("A65536".End(xlUp).Row)
Range("K1",sLastCell).Select
Selection.Formula = sFormula
I get the following error when running this code:
"Method 'Range' of object '_Global' failed"
Does anybody know why this would be.