Clinton
2013-01-31 05:55:58 UTC
The column letter is from using the worksheet_change event from the Target reference and passed into another procedure.
The code to call the function is
Dim columntouse As Integer
columntouse = ConvertColumnToInt(firstcolumn)
(Firstcolumn is one of the procedure parameters passed)
The function code is:
Public Function ConvertColumnToInt(columnstring As String) As Integer
Dim OutputNumber As Integer
Dim Leng As Integer
Dim i As Integer
Leng = Len(columnstring)
OutputNumber = 0
For i = 1 To Leng
OutputNumber = (Asc(UCase(Mid(columnstring, i, 1))) - 64) + OutputNumber * 26
Next i
End Function
However, the value in "columntouse" remains at zero; how do I get the result from the function to pass into it?