Error Trap Needed

torweb

Board Regular
Joined
Dec 1, 2003
Messages
136
Ok..I've tried several time to get something working here. I'm looking to insert an error trap that will display a msg that "The number of entries has been exceeded" This will happen when the user tries to build something with more that 40 lines of entries. I've pasted the section of code where I think it should go...any input will insure good Karma!! :biggrin:

Application.ScreenUpdating = False
With Sheets("RecipeCard")
.Range("A12:F60").Value = Sheets("RecipeTracker").Range("P11:U300").Value
With .Range("A12:A60")
.Replace What:="0", Replacement:="", LookAt:=xlWhole
.SpecialCells(xlBlanks).EntireRow.Delete

End With
End With
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
hi!
im not sure if A column is the reciept number that shoud not exceeed 40.
if so try this
Code:
if application.worksheetfunction.countA(range("a12:a60"))>40 then msgbox "you are over the limit of 40"
 
Upvote 0
Hey Hey...Sixth Sense. Good Call.

Now if I could, what can I do to send them back to revise their entries? The pop-up msg worked great, but it would be nice to send the back to revise the quantity of entries.

Please exucse me for not trying to muscle through this...but I've been working on this workbook since December 2003 and I think my brain is falling apart.

Thanks....!
 
Upvote 0
ok!
Code:
if application.worksheetfunction.countA(range("a12:a60"))>40 then 
msgbox "you are over the limit of 40"  & chr(13) & "do it again please"
goto r   ' r is a label you wan the user to go back or have him 
               exit the procedure
exit sub 'slect between the two.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,458
Members
449,085
Latest member
ExcelError

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top