Arrays

  • Thread starter Thread starter David
  • Start date Start date
D

David

I am going to just pasta my data example.

1/2/2004 Tom 285.00
12/19/2003 Tom 232.78
1/2/2004 Mark 220.56
12/19/2003 Mark 721.26
12/19/2003 Mark 854.82

I want to do an array where for Tom, (the dates and dollar
amounts fill into my userdefine variable that only contain
the dates and amount) and the same with Mark.

Can anyone Please Help
 
David,

Type Transaction
TransDate As Date
Amount As Currency
End Type

Sub testit()
Dim arrTom(1) As Transaction, arrMark(2) As Transaction

arrTom(0).TransDate = "02-Jan-2004": arrTom(0).Amount = "285.00"
arrTom(1).TransDate = "19-Dec-2003": arrTom(1).Amount = "232.78"
arrMark(0).TransDate = "02-Jan-2004": arrMark(0).Amount = "220.56"
arrMark(1).TransDate = "19-Dec-2003": arrMark(1).Amount = "721.26"
arrMark(2).TransDate = "19-Dec-2003": arrMark(2).Amount = "854.82"
End Sub

Rob
 
It isn't clear what you want the output to be. E.g., for Tom, where do
you want the two dates and amounts to end up?

Alan Beban
 
Thanks Rob for answering.

I have another question. What if there are more fifty names with
similiar corresponding dates and amounts? In otherwords, I want the
names to be variables as well as the amounts and dates.
 
Those arrays are defined at design time. It's certainly possible to define
arrays at runtime.
To give you a good answer, could you tell me what you want to do with the
data once it's in an array?
 
I will send the data to a Microsoft outlook email where each person on
the list will receive the data in the body of an email.

Thanks in advance for you help.
 
Back
Top