How to keep a Variable alive after a Call to Sub Routine

D

Dennis

XL 2003

Placed Public TextVar As Variant at beginning of Module

Dim TextVar as Variant (in 1st proceedure)
Then
Dim TextVar as Variant (in 2nd proceedure)
Then
Dim TextVar as Variant (in both proceedures)


"TextVar" is is set with 400+ Text characters and carries that value until
the "End Sub" of the 2nd procedure.

When I attempt to use TextVar in the 1st Procedure, its value is "Empty"

Yes, I know about the 255 limit for Strings is it also true for Variants?
Is that limit blowing my variable?

If so, is there a workaround?


Thanks,
Dennis
 
D

Dennis

Thanks Chip

I attempted Static TextVar As Variant
in either and both procedures but TextVar was still "Empty".

What ultimately worked was:

Dim TextVar As Variant

(Placed outside of both procedures)

Dennis
 
Top