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 Reset a User Defined Types Values

I have a UDT that is used by a userform to calculate the price of a product.
Is there a way to reset the UDT? For example, you can reset an object with
Set Object = Nothing, or reset a variable with Variable = Empty.

The problem occurs when I fill out the userform, set Checkbox1 = True, and
click my CommandButton1 below, a price calculates and the userform remains
open. But if I set Checkbox1 = False then click the buttton, the price
remains the same. The price should be $300 less. This is why I need to
reset the UDT. I have alot of If...Then statements and I would prefer not to
do Else .Illuminated = 0 .Mounted = 0.

'in standard module
Type Sign
Height As Double
Width As Double
Illuminated As Currency
Mounted As Currency
End Type

' userform code
Option Explicit
Base Option 1

Dim TEST As Sign

Sub CommandButtton1_Click()

With TEST
.Height = textbox1
.Width = textbox2
If Checkbox1 = True Then
.Illuminated = 100
.Mounted = 200
End If
End With
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
Reading values into an array of User Defined Types Susan[_6_] Excel Programming 6 December 12th 07 01:47 PM
Checking user defined types for Nothing jayklmno Excel Programming 5 May 3rd 06 09:21 PM
subs or functions with user defined types Ray Pixley Excel Programming 2 February 27th 06 03:25 AM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM


All times are GMT +1. The time now is 04:20 PM.

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"