How do I define a range by using cells as coordinates?

C

CRP

Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel In VBA, I could do something like this:

dim r as range
r=range(range('A1'),range('B5'))
in order to have r referencing range A1:B5

how do I do that with applescript?

Thanks
Chris
 
B

Bob Greenblatt

You'll have to be more specific in you question. I cna think of a
zillion ways to do this but have no idea what you want. Please supply an
example of the data and what you'd like to do.

AND, ask you question in the message body. NOT the subject line.
 
C

CRP

lets say that I have a 400 by 5 array in memory, and that I want to write it onto an excel sheet without having to go the one cell at a time way. in vba, I would do something like
range(destcell,destcell.cells(400,5)).value=myarray
 
B

Bob Greenblatt

lets say that I have a 400 by 5 array in memory, and that I want to
write it onto an excel sheet without having to go the one cell at a time
way. in vba, I would do something like
range(destcell,destcell.cells(400,5)).value=myarray
I'm still not sure what you are trying to do. Where do you wish to refer
to the Excl array? In Excel? In a DLL? How is stuff "in memory"? Where
did it come from?

If you want the value of cell(s) to define an array boundary, have you
looked at the Indirect function? what about array formulas? I still have
no clue as to what you want.
 
C

CRP

I might have a variant, which is, for example, the result of a sql query from a database, then I may have a macro like the following that writes the array onto a worksheet

sub WriteVariantToRange(arr as variant, dest as range)
r=ubound(arr)
c=ubound(arr,2)
range(dest,dest.cells(r,c)).value=arr
end sub
 
J

John_McGhie_[MVP]

You can't access memory with Mac VBA.

You can't do VBA at all in Excel 2008.

You may be able to accomplish what you mean using a native SQL query within
Excel.

See the Excel help topic "Import data from a database" for more information.

Hope this helps

I might have a variant, which is, for example, the result of a sql query from
a database, then I may have a macro like the following that writes the array
onto a worksheet

sub WriteVariantToRange(arr as variant, dest as range)
r=ubound(arr)
c=ubound(arr,2)
range(dest,dest.cells(r,c)).value=arr
end sub

This email is my business email -- Please do not email me about forum
matters unless you intend to pay!

--

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:[email protected]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top