+ Reply to Thread
Results 1 to 2 of 2

Counter in code

  1. #1
    Forum Contributor
    Join Date
    01-18-2005
    Posts
    238

    Counter in code

    Can someone please help me with the following?

    I am currently using a countblank formula

    when the sheet opens I store the number from the countblank formula

    then when I call a procedure, if the number from the formula is less I know that something has been added.

    I am currently using a sheet with a formula

    Is there anyway to store the number in vba only

    so

    when the sheet opens, a code checks for the number of blank cells in range (e.g. Sheet 1 A1:Z1)
    and stores that number

    then when you call your procedure

    if the current number of blank cells in less than the stored number on open then it will let you know

    thansk

    Josh

  2. #2
    Forum Contributor
    Join Date
    03-15-2005
    Location
    North Carolina
    MS-Off Ver
    2003 & 2007
    Posts
    180
    Josh, you could try something like this:

    Please Login or Register  to view this content.
    To load the currently used range on sheet1. Change to whatever sheet applies for you.

    Please Login or Register  to view this content.
    This will check the usedrange before your procedure runs and compare it to the usedrange when the workbook was open to see if anything has been added on that sheet.

    I think the Public declaration of rngStart needs to be in your module whereas the Workbook_Open routine goes in ThisWorkbook. HTH
    jtp

+ 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