I have a problem when I try to use a variable created in a subroutine in another subroutine. In the following example, I create variables Power_Origine, Power_Destination, ... in the Sub part0, I can use one of them in the Sub part1, but I can't use more than 1 variable in a single subroutine (part2).
Sub part0()
Power_Origine = 1
Description_Origine = 2
KnownUser_Origine = 3
Power_Destination = 1
Description_Destination = 2
KnownUser_Destination = 3
part1 (Power_Destination)
part2 (Power_Origine, Power_Destination, Description_Destination, KnownUser_Destination)
'part2 Power_Origine, Power_Destination, Description_Destination, KnownUser_Destination ' This does not work either
End Sub
Sub part1(Power_Destination As Integer)
MsgBox Power_Destination
End Sub
Sub part2(Power_Origine As Integer, Power_Destination As Integer, Description_Destination As Integer, KnownUser_Destination As Integer)
MsgBox "Hello " & Power_Destination & Description_Destination
End Sub
How can I call these 4 variables (Power_Origine, Power_Destination, Description_Destination, KnownUser_Destination) in the subroutine part2 ?
Thank you.