#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default arrays

hello,

I want to assign about 100 variables, i want to do this in an array.
These varables are found in cells a1 to a100. Not all cells are full
Does anybody has some sample code?

Regards,
Nie

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default arrays

Try this:-

**********************

Option Explicit

Option Base 1

Sub fillArray()

Dim arrayToFill(100) As Variant
Dim i As Long

For i = 1 To 100
arrayToFill(i) = Me.Range("A" & i)
Next

End Sub

******************

hth, TonyM


-----Original Message-----
hello,

I want to assign about 100 variables, i want to do this

in an array.
These varables are found in cells a1 to a100. Not all

cells are full.
Does anybody has some sample code?

Regards,
Niek


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default arrays

.... or more simply

Dim myArray

myArray = Range("A1:A100")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"TonyM" wrote in message
...
Try this:-

**********************

Option Explicit

Option Base 1

Sub fillArray()

Dim arrayToFill(100) As Variant
Dim i As Long

For i = 1 To 100
arrayToFill(i) = Me.Range("A" & i)
Next

End Sub

******************

hth, TonyM


-----Original Message-----
hello,

I want to assign about 100 variables, i want to do this

in an array.
These varables are found in cells a1 to a100. Not all

cells are full.
Does anybody has some sample code?

Regards,
Niek


---
Message posted from http://www.ExcelForum.com/

.



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
VBA arrays Matt Excel Discussion (Misc queries) 3 February 22nd 09 06:36 PM
Use of arrays Dave F Excel Worksheet Functions 0 November 30th 06 04:26 PM
Use of arrays DKS Excel Worksheet Functions 0 November 30th 06 04:11 PM
Arrays Tobro88 Excel Discussion (Misc queries) 3 November 18th 05 11:28 PM
arrays Dave B[_3_] Excel Programming 2 November 11th 03 03:32 AM


All times are GMT +1. The time now is 12:46 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"