+ Reply to Thread
Results 1 to 5 of 5

Macro to select a column that varies in number of rows from report to report

  1. #1
    Registered User
    Join Date
    09-04-2014
    Location
    Austin, Texas
    MS-Off Ver
    2010
    Posts
    36

    Macro to select a column that varies in number of rows from report to report

    Howdy from Austin,

    I am running a macro on a monthly report that contains credit card Transaction Amount data. The quantity of Transaction Amount column rows vary from month to month.

    I have a formula to format the text data into currency, but I want the macro to work for each monthly report regardless of how many rows.
    Since every report has a different quantity of rows, how do I create a macro that determines the exact number of rows in the Transaction Amount column?

    Thanks,
    Mark

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Macro to select a column that varies in number of rows from report to report

    You can safely apply currency formatting to the entire column. Change, for example:

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    09-04-2014
    Location
    Austin, Texas
    MS-Off Ver
    2010
    Posts
    36

    Re: Macro to select a column that varies in number of rows from report to report

    Thank you, Bernie.

    My issue is how do I create a macro that can select the exact number of rows in a column that changes every month? It's the same column in each monthly report, but every month has a different number of records (rows).

    I need to be able to know how many rows there are each time so my formatting formula stops at the last row of the column.

    Hope that makes sense.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Macro to select a column that varies in number of rows from report to report

    Code like this will identify the last used row, based on the cells of column B

    Please Login or Register  to view this content.
    But, again, formatting the entire column is OK....

  5. #5
    Registered User
    Join Date
    09-04-2014
    Location
    Austin, Texas
    MS-Off Ver
    2010
    Posts
    36

    Re: Macro to select a column that varies in number of rows from report to report

    Thanks Bernie....I'll give it a try!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro for a popup window to select multi-documents and to add them into a report
    By IonutC in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-27-2016, 02:06 PM
  2. Agging report, openingbalance report,customer report vab code was not working
    By rana19 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-28-2015, 03:38 AM
  3. Replies: 4
    Last Post: 08-18-2015, 10:02 AM
  4. How do I auto select yes when macro exits a report
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-16-2014, 12:37 PM
  5. [SOLVED] Reducing number of macros needed to hide rows for monthly report
    By PaxCasey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-16-2012, 09:33 AM
  6. Add totals at end of the report with unknow number of rows with VB
    By SITCFanTN in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 06-04-2006, 03:20 PM
  7. Need to select/report all rows based on content
    By Kristin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-20-2006, 02:00 PM

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