+ Reply to Thread
Results 1 to 3 of 3

How to set range to number of rows found?

  1. #1
    Registered User
    Join Date
    05-07-2004
    Posts
    33

    How to set range to number of rows found?

    Here is what I want to do. I ran a function to find the number of rows is filled or has values in it. Then I want to set the range according to this number of rows.

    Please Login or Register  to view this content.
    Now, the above set code is not working but something that I wanted to do. Is it possible to do something like that in Excel VBA?

    ljCharlie

  2. #2
    Forum Contributor
    Join Date
    03-03-2005
    Posts
    316
    To create a dynamic range in VBA, several techniques are possible but this will get you started. Suppose you want to create a variable Range in Column A, such that the last row with data will be reflected always as the bottom row. Use:

    set rng = Range("a1:a" & Range("a65536").End(xlUp).row)

    HTH

  3. #3
    Registered User
    Join Date
    05-07-2004
    Posts
    33
    Many thanks for the help. I'll give that a try.

    ljCharlie

+ 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