I am looking for a way to pass the ReturnValue of n from function as a numCells to loop a subroutine like so, Call nameSub. Is this possible?
I want to perform arithmetic on two variables with assigned value. For example:
I have been trying to figure this out for a few weeks, and reached out to you yesteray as this thread shows, but I've scrapped that for now; I'm focusing on smaller parts for now because I want to learn all parts carefully as I am learning VBA as I go along and would appreciate your help.
Edited for formatting
I want to perform arithmetic on two variables with assigned value. For example:
Code:
Function mathie(aCur as Integer, preVious as Integer)
Dim Cat as string, Dog as string, horse as string
Cat = 1
Dog = 2
Horse = 3
' And the function would match the string in a cell to the dog/cat/or horse.
' A previous cell might have been Dog, and the next cell in the same
' row is Horse, I would like to also find out how to match named
' variables to text strings. However, I will ask this question another
' time (as briefly mentioned in my last paragraph).
Dim n as variant
n = ReturnValue
aCur = ActiveCell
preVious = ActiveCell.Offset(0, -1).Select
End Function
Sub loopie(numCells)
For i = 1 To last_col
.. do something
Next
End Sub
Sub routine()
Call loopie(n(Horse - Dog))
End Sub
I have been trying to figure this out for a few weeks, and reached out to you yesteray as this thread shows, but I've scrapped that for now; I'm focusing on smaller parts for now because I want to learn all parts carefully as I am learning VBA as I go along and would appreciate your help.
Edited for formatting
Last edited: