+ Reply to Thread
Results 1 to 4 of 4

selecting a range with two variables

  1. #1
    Forum Contributor
    Join Date
    01-18-2005
    Posts
    238

    selecting a range with two variables

    Can someone please show me how to select a range with two variables

    x and y

    i know how to do

    Please Login or Register  to view this content.
    but how do i do the following

    Please Login or Register  to view this content.
    , using x and y instead of 1 and 500


    thanks

    Josh
    Last edited by VBA Noob; 03-31-2008 at 01:49 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    What exactly are you doing? What is determining X & Y?
    You don't usually need to select a range in VBA
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Josh,

    Here are a couple of ways to use variables in a range address. It is important to remember that the row variable needs to be declared as a Long type. The column variable can be declared as a Variant type, since it can take a string or long data type.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  4. #4
    Forum Contributor
    Join Date
    01-18-2005
    Posts
    238

    thanks Leith

    that worked great


    Josh

+ 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