Stopping Macro After Certain Cell

P

PRINCE21

I have created a form that staff members have to fill in, the data o
this form is submitted to a database. So basically when ever someon
fills it in he/she clicks submit and a new row of data is created i
the next sheet.

How can i disable the macro that does this say after 10 new rows hav
been filled in. So when all ten members have filled in there data n
more can. The macro will not work.

Is there a way to do something like this!!

Please help than
 
D

Dave Peterson

Maybe instead of disabling your macro, you could just check to see if the limit
had been reached.


Option explicit
sub testme01()
dim myRng as range
set myrng = worksheets("Input").range("a7:a16") 'or what ever

if application.counta(myrng) = myrng.cells.count then
exit sub
end if

'else continue with your regular macro.

end sub
 
T

Tom Ogilvy

You might include this type of code at the end of your macro and have it
tell the user that the limit has been reached.
 
Top