PC Review


Reply
Thread Tools Rate Thread

Adding to arrays

 
 
Steve
Guest
Posts: n/a
 
      29th May 2008
Hi

I'm new to arrays and although I think I can work most of it out using the
help file, i'm struggling to find out how I add to an array.

e.g.

a=(1,2,3,4)

How can I add 5 to the end

Your help would be much appreciated.

Many Thanks

Steve
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      29th May 2008
Check out the ReDim method in VBA help.

"Steve" wrote:

> Hi
>
> I'm new to arrays and although I think I can work most of it out using the
> help file, i'm struggling to find out how I add to an array.
>
> e.g.
>
> a=(1,2,3,4)
>
> How can I add 5 to the end
>
> Your help would be much appreciated.
>
> Many Thanks
>
> Steve

 
Reply With Quote
 
Steve
Guest
Posts: n/a
 
      29th May 2008
Thanks, I can see that this resizes teh array but still not sure how to add
to the array.

Maybe I'm missing something here!!#

Cheers

Steve

"JLGWhiz" wrote:

> Check out the ReDim method in VBA help.
>
> "Steve" wrote:
>
> > Hi
> >
> > I'm new to arrays and although I think I can work most of it out using the
> > help file, i'm struggling to find out how I add to an array.
> >
> > e.g.
> >
> > a=(1,2,3,4)
> >
> > How can I add 5 to the end
> >
> > Your help would be much appreciated.
> >
> > Many Thanks
> >
> > Steve

 
Reply With Quote
 
Alan Beban
Guest
Posts: n/a
 
      29th May 2008
Dim a
ReDim a(1 to 4)
a=Array(1,2,3,4)
ReDim Preserve a(1 to 5)
a(5)=5

Alan Beban

Steve wrote:
> Thanks, I can see that this resizes teh array but still not sure how to add
> to the array.
>
> Maybe I'm missing something here!!#
>
> Cheers
>
> Steve
>
> "JLGWhiz" wrote:
>
>
>>Check out the ReDim method in VBA help.
>>
>>"Steve" wrote:
>>
>>
>>>Hi
>>>
>>>I'm new to arrays and although I think I can work most of it out using the
>>>help file, i'm struggling to find out how I add to an array.
>>>
>>>e.g.
>>>
>>>a=(1,2,3,4)
>>>
>>>How can I add 5 to the end
>>>
>>>Your help would be much appreciated.
>>>
>>>Many Thanks
>>>
>>>Steve

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arrays - declaration, adding values to arrays and calculation Maxi Microsoft Excel Programming 1 17th Aug 2006 04:13 PM
vba adding arrays =?Utf-8?B?SmVmZg==?= Microsoft Excel Misc 1 4th Nov 2005 02:50 PM
adding arrays Troy Microsoft C# .NET 5 25th Feb 2005 08:55 PM
Adding arrays =?Utf-8?B?RGFu?= Microsoft Excel Programming 1 12th Jan 2004 09:49 PM
Adding Arrays spre Microsoft Excel Programming 0 24th Jul 2003 04:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:17 AM.