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

Posted on 2009-12-16
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?

Question by:Datenkultur
    1 Comment
    LVL 19

    Accepted Solution

    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))


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
    This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now