+ Reply to Thread
Results 1 to 4 of 4

Macro Range Code based on Data Size

  1. #1
    Registered User
    Join Date
    10-19-2007
    Posts
    9

    Macro Range Code based on Data Size

    OK.....so I have a huge report of hotel guets requests that are dumped out of my wed based system into an excel workbook at the end of every month. The data is 26 or so columns wide, and usually between 2500 and 3000 rows long. I have to generate a report with different graphs and figures based on this info every month; the graphs use the same columns everytime, but obviously the number of rows of data in the worksheet changes every month.

    I'm currently trying to develop Macros for the graphing and data filtering (since doing it manually takes a LONG time each month)......my problem is that I dont know how to create a Macro where the range is self-adjusted based on the last filled-in row. Is there a way that Excel can determine what the last filled row is and adjust the range each time based on that value.

    Thanks in advance!
    Last edited by VBA Noob; 01-05-2008 at 03:54 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Non VBA way

    http://www.contextures.com/xlNames01.html#Dynamic

    VBA Way

    http://www.rondebruin.nl/last.htm

    http://www.ozgrid.com/VBA/ExcelRanges.htm

    http://www.vbaexpress.com/forum/showthread.php?t=9774

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    10-19-2007
    Posts
    9

    Smile Thank You...and a question

    Thanks Noob - I really appreciate it.

    I also wanted to ask you if you think VBA macros are the best way to go about generating reports. I know that there are other ways (report wizards) that can be created in Excel....but as an amateur I'm not sure what the best route would be. Any ideas?

    Thanks again!

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Depends what your doing. Link explains best practice for Design a sheet

    http://www.ozgrid.com/Excel/ExcelSpreadsheetDesign.htm

    VBA Noob

+ 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