#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 269
Default Array of Strings

I want to set up, for lack of a better term, an array of strings,
evidently a 2-D String array. The number of strings and the number of
characters per string will vary according to conditions. How do I
dimension the array?
Thanks,
James

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 718
Default Array of Strings

Hi Zone,

Dim myArray(10) as String

Strings are variable length per se.

HTH
--
AP

"Zone" a écrit dans le message de news:
...
I want to set up, for lack of a better term, an array of strings,
evidently a 2-D String array. The number of strings and the number of
characters per string will vary according to conditions. How do I
dimension the array?
Thanks,
James



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 269
Default Array of Strings

Thank you, Ardus. However, I did not make clear what I'm trying to do.
I want the array to hold a set of strings for use as a heading row.
Depending on the value of a cell in the selected row, I insert a
heading row before the selected row and put the correct heading above
each cell in the selected row. It seems very inefficient to use code
like

Select Case cells(activecell.row, "a")
Case "Alba"
myArray(1)="Alba Heading A"
myArray(2)="Alba Heading B"

and so on for 26 headings and 25 cases. I was hoping for a simpler
construct. Maybe I'm stuck with this. Any ideas?
Regards,
James


Ardus Petus wrote:
Hi Zone,

Dim myArray(10) as String

Strings are variable length per se.

HTH
--
AP

"Zone" a écrit dans le message de news:
...
I want to set up, for lack of a better term, an array of strings,
evidently a 2-D String array. The number of strings and the number of
characters per string will vary according to conditions. How do I
dimension the array?
Thanks,
James


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Array of Strings

Maybe...

dim myStrings(1 to 3, 1 to 7) as string

(this would result in a 3x7 array (21 elements))

Zone wrote:

I want to set up, for lack of a better term, an array of strings,
evidently a 2-D String array. The number of strings and the number of
characters per string will vary according to conditions. How do I
dimension the array?
Thanks,
James


--

Dave Peterson
Reply
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
Display an array of references andy62 Excel Worksheet Functions 1 July 6th 06 03:36 AM
How to multiply all cells in array by factor rhauff Excel Discussion (Misc queries) 2 March 21st 06 03:01 PM
Transpose words and numbers into array of different proportions Manfred Excel Discussion (Misc queries) 5 February 9th 06 01:07 AM
Formula to list unique values JaneC Excel Worksheet Functions 4 December 10th 04 12:25 AM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM


All times are GMT +1. The time now is 09:42 AM.

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

About Us

"It's about Microsoft Excel"