+ Reply to Thread
Results 1 to 5 of 5

Counting Data with Macro

  1. #1
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Counting Data with Macro

    Hi again everyone,
    I have an excel sheet that is populate by data when I run a Macro.
    Data could sometimes be in hundreds or at times in thousands.
    I was hoping to do a Macro that could do a count?
    Maybe start from A7 till the last record? Appreciate your assistance. Thank you in advance.

    Regards,
    Andrew
    Last edited by Andrew.Trevayne; 09-19-2011 at 02:35 AM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Counting Data with Macro

    Is column A always going to be populate? If so then this would work:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Counting Data with Macro

    Hi Andrew-R,
    Thank you for the response, this is working great! Just what I wanted.
    Could you help me also to Output the results in Column B7? At the moment I get a message box, thank you in advance,

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Counting Data with Macro

    Small modification required
    Sub CountData()

    Dim lDataRows As Long

    With ActiveSheet
    .range("b7").value =.Cells(.Rows.Count,1).End(xlUp).Row-6
    End With

    MsgBox lDataRows

    End Sub
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Counting Data with Macro

    @mudraker
    Hi! Thank you, it's working great! Appreciate your help.

+ 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