I am attempting to write a function that takes a range of data and calculates the ratio of two numbers from the columns provided by the user. I want to print this ratio out
Try adding Dim temp as Range and chagne temp = table.cells(counter, table.columns.count) to set temp = table.cells(counter, table.columns.count)
Dim temp as Range
temp = table.cells(counter, table.columns.count)
set temp = table.cells(counter, table.columns.count)
Really all you need to do is add the set, without it the Variant temp is becoming a long, with it the Variant would become a Range object.
set
Variant
long
Range