Results 1 to 2 of 2

Thread: Select A Range Dynamically Based On Count Of Values

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    4
    Rep Power
    0

    Select A Range Dynamically Based On Count Of Values

    Hi,

    I am trying to select a code using variables. Since the range is dynamic, I am using a counta function to determine the no of rows. Below is the code I have used, but its not correct.

    Code:
    Dim Nmbr As Integer
        Nmbr = Range("R1").Value
        Range("R1") = WorksheetFunction.CountA(Range("S:S"))
        Range("R2").Select
        Range("R2").Resize(Nmbr, 6).Select
    Thanks for your help!
    Last edited by Excel Fox; 02-19-2014 at 07:05 PM. Reason: Code Tags added

Similar Threads

  1. Convert Series into Range with specified count
    By ayazgreat in forum Excel Help
    Replies: 3
    Last Post: 11-09-2013, 01:41 PM
  2. IF STATEMENT BASED ON EQUAL VALUES IN RANGE
    By mrmmickle1 in forum Excel Help
    Replies: 3
    Last Post: 09-09-2013, 05:54 PM
  3. Replies: 2
    Last Post: 06-24-2013, 07:40 PM
  4. Change Display Range Based On Change of Dropdown Values
    By rich_cirillo in forum Excel Help
    Replies: 2
    Last Post: 03-29-2013, 04:58 AM
  5. Count consecutive value in a range using formula
    By LalitPandey87 in forum Excel Help
    Replies: 6
    Last Post: 11-12-2012, 05:23 PM

Posting Permissions

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