Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to initialize an array the same way you can initialize a
Variant? If so, what is the syntax? I tried to dim an array and make it equal to an array as below, but could not get it to work. Thanks. Dim DescArray As Variant, TrackColArray As Variant, ReportColArray As Variant DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", "SS Groom", _ "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kleev wrote:
Is there a way to initialize an array the same way you can initialize a Variant? If so, what is the syntax? I tried to dim an array and make it equal to an array as below, but could not get it to work. Thanks. Dim DescArray As Variant, TrackColArray As Variant, ReportColArray As Variant DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", "SS Groom", _ "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) What do you mean "could not get it to work." What happens? It works fine if you break your lines at the right point with appropriate continuation characters. E.g., DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", _ "SS Groom", "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) Alan Beban |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry. Yes this works fine. What I mean is change the dim statements to
refer to arrays not variants. ie dim descarray(9) and then try the following. I cannot get it to work. Sorry about the original phrasing. Once I posted it, I realized it was open to interpretation. "Alan Beban" wrote: Kleev wrote: Is there a way to initialize an array the same way you can initialize a Variant? If so, what is the syntax? I tried to dim an array and make it equal to an array as below, but could not get it to work. Thanks. Dim DescArray As Variant, TrackColArray As Variant, ReportColArray As Variant DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", "SS Groom", _ "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) What do you mean "could not get it to work." What happens? It works fine if you break your lines at the right point with appropriate continuation characters. E.g., DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", _ "SS Groom", "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) Alan Beban |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim descarray()
ReDim descarray(9) Alan Beban Kleev wrote: Sorry. Yes this works fine. What I mean is change the dim statements to refer to arrays not variants. ie dim descarray(9) and then try the following. I cannot get it to work. Sorry about the original phrasing. Once I posted it, I realized it was open to interpretation. "Alan Beban" wrote: Kleev wrote: Is there a way to initialize an array the same way you can initialize a Variant? If so, what is the syntax? I tried to dim an array and make it equal to an array as below, but could not get it to work. Thanks. Dim DescArray As Variant, TrackColArray As Variant, ReportColArray As Variant DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", "SS Groom", _ "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) What do you mean "could not get it to work." What happens? It works fine if you break your lines at the right point with appropriate continuation characters. E.g., DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", _ "SS Groom", "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) Alan Beban |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That did work and I thank you for the answer. I, however, made another
mistake. As soon as I posted my last reply, I realized that the way I had dimmed descarray was not quite complete. I should have written dim descarray(9) as string. Since I cannot get it to work other than as a Variant, I will just use that. It was just that I had heard so much about using Variants only when absolutely necessary, I would try to dimension the array as the correct type. Thanks. "Alan Beban" wrote: Dim descarray() ReDim descarray(9) Alan Beban Kleev wrote: Sorry. Yes this works fine. What I mean is change the dim statements to refer to arrays not variants. ie dim descarray(9) and then try the following. I cannot get it to work. Sorry about the original phrasing. Once I posted it, I realized it was open to interpretation. "Alan Beban" wrote: Kleev wrote: Is there a way to initialize an array the same way you can initialize a Variant? If so, what is the syntax? I tried to dim an array and make it equal to an array as below, but could not get it to work. Thanks. Dim DescArray As Variant, TrackColArray As Variant, ReportColArray As Variant DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", "SS Groom", _ "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) What do you mean "could not get it to work." What happens? It works fine if you break your lines at the right point with appropriate continuation characters. E.g., DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", _ "SS Groom", "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) Alan Beban |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook Dim DescArray() As String ReDim DescArray(9) Assign Array("Type", "Store", "Name", "FDO", "GO Weekend", _ "SS Groom", "Grooming", "DDC", "Phone"), DescArray Alan Beban Kleev wrote: That did work and I thank you for the answer. I, however, made another mistake. As soon as I posted my last reply, I realized that the way I had dimmed descarray was not quite complete. I should have written dim descarray(9) as string. Since I cannot get it to work other than as a Variant, I will just use that. It was just that I had heard so much about using Variants only when absolutely necessary, I would try to dimension the array as the correct type. Thanks. "Alan Beban" wrote: Dim descarray() ReDim descarray(9) Alan Beban Kleev wrote: Sorry. Yes this works fine. What I mean is change the dim statements to refer to arrays not variants. ie dim descarray(9) and then try the following. I cannot get it to work. Sorry about the original phrasing. Once I posted it, I realized it was open to interpretation. "Alan Beban" wrote: Kleev wrote: Is there a way to initialize an array the same way you can initialize a Variant? If so, what is the syntax? I tried to dim an array and make it equal to an array as below, but could not get it to work. Thanks. Dim DescArray As Variant, TrackColArray As Variant, ReportColArray As Variant DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", "SS Groom", _ "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) What do you mean "could not get it to work." What happens? It works fine if you break your lines at the right point with appropriate continuation characters. E.g., DescArray = Array("Type", "Store", "Name", "FDO", "GO Weekend", _ "SS Groom", "Grooming", "DDC", "Phone") TrackColArray = Array(1, 3, 4, 5, 6, 7, 8, 9, 12) ReportColArray = Array(1, 2, 4, 5, 6, 7, 8, 9, 10) Alan Beban |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
initialize userform, using a sub | Excel Programming | |||
Initialize macro | Excel Programming | |||
Initialize variable | Excel Programming | |||
need form to initialize without closing | Excel Programming | |||
Initialize data in new row? | Excel Programming |