View Single Post
  #16   Report Post  
Dave Peterson
 
Posts: n/a
Default

Just remember where you stored a copy--and use it without thinking.

It works for me!

Jack Sons wrote:

Dave,

Finally I got it, works like a charm, thanks a lot.
BTW, qSort is a mistery to me.

Jack.

"Dave Peterson" schreef in bericht
...
For fCtr = LBound(myNames) To UBound(myNames)
'do what you want here.

'------------------------------------------------------------------------
Set mybook = Workbooks.Open(mypath & myNames(fctr) & ".xls")

That's what I was trying to show with the msgbox:
MsgBox myPath & myNames(fCtr) & ".xls"

You have to rebuild the name--that's why you couldn't use "0000888.xls" as
a
file name and still have it work.


Jack Sons wrote:

Dave,

I tried to do as you said.
Now I have this piece of code:

Call qSort(myNames)
For fCtr = LBound(myNames) To UBound(myNames)
'do what you want here.

'------------------------------------------------------------------------
Set mybook = Workbooks.Open(myNames)

I think after Call qSort(myNames) myNames is an array sorted like

8.xls
25.xls
123.xls
333.xls
763.xls
1066.xls
1230.xls
1363.xls
2155.xls
2308.xls

(is that called numerical in contrast to alphabetical, is alphabetical
the
order 1066.xls 123.xls 1230.xls .... 25.xls ..... 8.xls?).

My next line of code should open the file indicated by the first element
of
array myNames, so 8.xls. This won't work because - I suppose -
Workbooks.Open does not accept an array.

I think I am close to the solution, so please help me further.

Jack.

"Dave Peterson" schreef in bericht
...
I googled for "Sub qSort" and keepitcool has posted this several times.

Dave Peterson wrote:
<<snipped
I used a QSort
procedure that I saved from a newsgroup post (sorry about not
remembering
the
author/authors.)

<<snipped


--

Dave Peterson


--

Dave Peterson