+ Reply to Thread
Results 1 to 3 of 3

Stop Macro adding when cell value is reached?

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Stop Macro adding when cell value is reached?

    Hello Everyone,

    I am using the below line of code to add a number to cell A1. This is working great but I
    do not want it to add past 25. The highest number needs to be 25. When 25 is reached I
    want to the macro to stop working! I have tried to change things but to no avail! I can do
    this with formulas no problem but it needs to be done with VB!

    Sub Margate()
    Range("A1") = Range("A1") + 1
    End Sub

    Thank you in advance for any help

  2. #2
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Stop Macro adding when cell value is reached?

    Hello Margate,

    There many variants.
    Please Login or Register  to view this content.
    Harry.

  3. #3
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Stop Macro adding when cell value is reached?

    HSV,

    Thank you very for such a quick response. This works perfectly. I was trying every way but am just not that great at VB!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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