View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RyanH RyanH is offline
external usenet poster
 
Posts: 586
Default User Type vs. Variable

I have several user forms that I use to calculate costs of different types of
products. One userform per product. I would like to know the advantages and
disadvantages of using variables or my own user types. For example,

' user types in standard module
Type Sign
SignHeight As Double
SignWidth As Double
End Type

' userform button code
Sub Calculate()

Dim EMC As Sign

With EMC
.SignHeight = TextBox1 + TextBox2
.SignWidth = TextBox3 + TextBox4
End With

End Sub

VS.

Sub Calculate()

Dim SignHeight As Double
Dim SignWidth As Double

SignHeight = TextBox1 + TextBox2
SignWidth = TextBox3 + TextBox4

End Sub
--
Cheers,
Ryan