View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H. Mike H. is offline
external usenet poster
 
Posts: 471
Default I need a macro to run on a set condition

Place a line of code in the macro that runs when they click the button before
anything happens:
if cells(6,1).value<empty then
msgbox(prompt:="You may Not enter anything else, the file is full!",
title:="Entry Not Allowed", buttons:=Vbcritical)
goto theend
end if

Then place a marker at the bottom:

TheEnd:
end sub
"Savuti" wrote:

I have a macro assigned to an enter button on a spreadsheet. When the enter
button is pushed, data entered into row 1 (the data entry cell) is moved to
row 2 and so on until row 6. Rows 2 to 6 are locked out to prevent anyone
from accidentally deleting or overwriting data in those rows. I would like a
condition set that when data gets to row 6, the last row, a message box
informs that the list is full. And at that point when the enter button is
clicked the original macro does not run until the list is deleted. I do have
a macro for the deletion part.
Please help.....