excel

farshad

Well-known member
Joined
May 1, 2003
Messages
109
Location
London
I am using vb.net to populate an excel sheet fine...
But when using:
.ActiveCell.FormulaR1C1 = "=MIN(C" & intFirstYellow & ":C" & intLastYellow & ")"

to place a formula i.e. =MIN(C5:C7)

does not work accurately, it place =MIN($E:$F) instead.

Can you see why?
Thanks
 
Is intFirstYellow an integer? if so you are trying to combine an integer with a string.
Try .ActiveCell.FormulaR1C1 = "=MIN(C" & str(intFirstYellow) & ":C" & str(intLastYellow) & ")"
 
Use native .Net rather than the compadibility functions:
Code:
.ActiveCell.FormulaR1C1 = "=MIN(C" & intFirstYellow.ToString & ":C" & intLastYellow.ToString & ")"
Native functions are supposed to be faster than the compatiblility ones
 
Back
Top