clearing a variable defined by Type statement

diddi

Well-known Member
Joined
May 20, 2004
Messages
3,337
Office Version
  1. 2010
Platform
  1. Windows
hi and easter greets to all. i have set up a number of variables using the Type structure which i use for getting and putting data to Random files. eg a variable called Payment to record customer payment info such as date and payment method etc.

Code:
Type Payment
    D As Date
    cn As Integer
    Pay As Single
    Meth As Integer
    Chq As Long
    ReMare As Integer
End Type

is there a simple way to clear all values in the variable or do i have to do this?
Code:
Payment.Date=0
Payment.cn =0
Payment.Pay =0
Payment.Meth =0
Payment.Chq =0
Payment.ReMare =0


thx
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Nope, you've got to set them all manually. Not sure why you'd go with a Type declaration though. They're not very user friendly IMHO. Plus they're static and only called at run time. It would seem that a class would be better. Why don't you take a read here for some good information....

http://www.cpearson.com/excel/Classes.aspx

HTH
 
Upvote 0
that link looks like the perfect solution. thx Zack
i'll do some homework!
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,377
Members
448,955
Latest member
BatCoder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top