I created a sub in one module with the following code:
Public Sub lastrow(start As Integer, col As Integer, last As Integer)
i = start
Do
i = i + 1
currentcell = Cells(i, col)
Loop Until IsEmpty(currentcell)
last = i - 1
End Sub
When I call the sub in the current module using the code -
Call lastrow (5, 1, lcr)
it works fine and i create a variable lcr with an integer value. However, when I open another module and run the same code I get an error message "Ambiguous name detected: lastrow"
Any suggestions?
Public Sub lastrow(start As Integer, col As Integer, last As Integer)
i = start
Do
i = i + 1
currentcell = Cells(i, col)
Loop Until IsEmpty(currentcell)
last = i - 1
End Sub
When I call the sub in the current module using the code -
Call lastrow (5, 1, lcr)
it works fine and i create a variable lcr with an integer value. However, when I open another module and run the same code I get an error message "Ambiguous name detected: lastrow"
Any suggestions?