LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default array functions

extract of my code

Dim i As Integer
Dim j As Integer
Dim sh As Worksheet
Set sh = ThisWorkbook.Worksheets("sheet2")
Dim mysectors As Range
Dim sector1 As Range
Dim sectorlast As Range
Set sector1 = sh.Range("c2")
Set sectorlast = sh.Range("c2").End(xlDown)
Set mysectors = Range(sector1, sectorlast)
j = WorksheetFunction.CountA(mysectors)
MsgBox j
Dim wkbk() As String****************
Dim mypath As String
mypath = "e:\temporary\choksey\choksey 18-10\"
For i = 1 To j
wkbk(i) = mypath & Sheet2.Range("c2").Offset(i - 1, 0) & ".xls"

with this code when I come to the last statement error "subscript out of
range" comes
But if amend the stament marked *******as <dim wkbk(16) as string
it works.
My problem is the the array dimension changes.
instead of having wkbk() as dynamic aarray can I give a larger value for
dimension for e.g
wkbk(50) and use only 15 or 16 or 20 wkbk()
or any other soluton
thanks and regards.


 
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
Array functions anand Excel Worksheet Functions 6 January 26th 07 11:33 PM
array functions Barak Excel Worksheet Functions 5 September 29th 06 03:53 AM
efficiency: database functions vs. math functions vs. array formula nickname Excel Discussion (Misc queries) 2 July 14th 06 04:26 AM
Array functions rmellison Excel Discussion (Misc queries) 8 September 9th 05 09:22 AM
Array Functions Alan Beban[_2_] Excel Programming 0 April 23rd 04 02:18 AM


All times are GMT +1. The time now is 11:27 AM.

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

About Us

"It's about Microsoft Excel"