![]() |
Adding to arrays
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 |
Adding to arrays
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 |
Adding to arrays
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 |
Adding to arrays
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 |
All times are GMT +1. The time now is 01:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com