+ Reply to Thread
Results 1 to 3 of 3

Select range by using variables for row and column

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    Frankfurt, Germany
    MS-Off Ver
    Excel 2003
    Posts
    4

    Select range by using variables for row and column

    Hi,

    I'm currently trying to select a Range by using variables for row and column number.
    Here's the whole thing I'm trying to do:
    1) select a unique ID in Worksheet A and store this in a variable called ISIN
    2) jump to Worksheet B and find the row in col A that contains this unique ID (I do this by using Cells.Find...)
    3) I store the row number in a variable called REIHE
    4) I find and store the column number with the last value (see code below) in a variable called SPALTE

    This is where i don't get any further. I'm using the following code to select a range, but it always produces a runtime error. Any Help would be highly appreciated! I'm using/have to use Excel 2003...

    Please Login or Register  to view this content.
    EDIT: Just to complete the picture: My ultimate goal is to create a Graph from this and another Range. Idea is to replace the bold code below by the code (or code similar to that) above....

    Please Login or Register  to view this content.
    Last edited by Chris79; 11-01-2012 at 09:51 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Select range by using variables for row and column

    try with
    SPALTE = .UsedRange.Columns.Count
    Last edited by patel45; 11-01-2012 at 09:55 AM.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    10-16-2012
    Location
    Frankfurt, Germany
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Select range by using variables for row and column

    Hi patel45,

    Thanks for your reply. I've also been able to make some progress on my own:
    Please Login or Register  to view this content.
    This gives me the correct ranges back. I thought names ranges would make it easier to refer to when it comes to draw the graph i mentioned in the second part of my thread, but so far no luck... I think i will open a new thread regarding my problem with the graph. Topic of this thread doesn't look right any more.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1