
Originally Posted by
ledzepe
How about passing two variables from a sub to a function? As in my earlier example:
Sub Main()
Dim Source, Dest
Source = Z24
Dest = T28
SpecialFunc
bla, bla, bla....
End Sub
Function SpecialFunc()
Range(Source).Select
Range(Dest).Select
bla, bla, bla....
End Function
What I'm trying to accomplish is copying a cell to another cell. The cell positions move that is why I need to pass cell (source and destination) address variable to the function. If there's a better way, please tell me.
Hi,
as
Sub test()
myvar = "testing"
testme ("test"), "Test2", "test3", myvar
End Sub
Function testme(mytest As String, mytest2 As String, mytest3 As String, myvar)
MsgBox mytest & myvar
End Function
hth
---
btw, your earlier sub may have set two variables, but the Function only indicated using one of them.
---
Bookmarks