LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
clearing a user-defined Type variable Chip Pearson Excel Programming 0 December 28th 06 06:04 PM
Type Mismatch: array or user defined type expected ExcelMonkey Excel Programming 4 July 6th 06 03:40 PM
Clearing all values in a User Defined Type variable J Streger Excel Programming 2 April 27th 06 08:01 PM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
User Defined Type Structure - want it to be variable not numeric literal WyoCracker Excel Programming 1 July 21st 03 09:28 PM


All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"