Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    15

    Unanswered: excel macro to subtotal

    I have a macro to subtotal a set of data. This data will always be different amount of lines. I can set the macro to subtotal only current range. If I try to include all lines so that I account for when the lines of data increase, it will not allow the first line to be included. Any ideas?

  2. #2
    Join Date
    Jan 2003
    Location
    Vietnam
    Posts
    188
    how do you get the current range?
    qha_vn

  3. #3
    Join Date
    Aug 2003
    Posts
    15
    i just got it from selecting the range. If i use the current range, everything is fine, but it is when i expand the range beyond the current data to accomadate for future expansion is where i have the problem.

  4. #4
    Join Date
    Jan 2003
    Location
    Vietnam
    Posts
    188
    i meant do you use something like this in ur macro

    Range("A1").Select
    Selection.CurrentRegion.Select

    provided that your first cell in data range is A1, these codes always select all rows for you when you run the macro even if you have 2 rows or 2000 rows in your data range as long as there is no blank row(s) separate(s) the data range.

    hope this helps
    Last edited by qha_vn; 08-14-03 at 08:30.
    qha_vn

Posting Permissions

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