?
Solved

Excel Range - How to get a reference of a range by coordinates ?

Posted on 2009-12-16
1
Medium Priority
?
401 Views
Last Modified: 2013-11-25
Hi all,

I need to get an excel.range-object. I have the coordinates of the range (X,Y, the row-count and the column-count).

I only found:
Set rngResult = objWorksheet.cells(x,y).

But i need something like:
Set rngResult = objWorksheet.cells(x1,y1,x2,y2).

Is there a standard function, or do I have to implement it myselfe?


0
Comment
Question by:Datenkultur
1 Comment
 
LVL 19

Accepted Solution

by:
david251 earned 2000 total points
ID: 26062975
I assume you want a range like a1:c3.  You can use this instead

Set rngResult = objWorksheet.Range(objWorksheet.Cells(1,1),objWorksheet.Cells(3,3))

HTH,
-david251
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question