View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default type variable as argument of a sub

Koos,

Do you mean a structure variable defined with the Type identifier? If so,
then the answer is yes, you can pass types to procedures. For example,

Public Type TheType
X As Integer
Y As Integer
End Type

Sub AAA()
Dim T As TheType
T.X = 123
T.Y = 456
BBB T
End Sub

Sub BBB(TT As TheType)
Debug.Print TT.X
Debug.Print TT.Y
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Koos" wrote in message
...
Hello all,

I am not very experienced in excel programming. But I am wondering
whether it is possible to pass a type variable as an argument to a sub
or function. I am using excel 97 sr-2.

thanks in advance,
Koos