LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default error handler not working correctly

Oh wise ones,
From the existing code below I crudely added some
error code from right out of the help section. The form would crap out to
debug mode if a valid red tag number was not entered. I just wanted it to
display a message and start the sub again. Now is displays a message but goes
to the next form and the data is put in the wrong cells. I would be shocked
if you guys took more the 3 seconds to fix this one. Please advise.

Thanks,
Mike

Sub Sup()
Dim Message, Title, Default, Squares
Dim closetag As Integer
On Error GoTo ErrorHandler<< I added this
Message = "Enter the red tag number that was reworked" ' Set
prompt.
Title = "Red Tag Number" ' Set title.
Default = "0" ' Set default.
closetag = InputBox(Message, Title, Default)
Worksheets("Closed Red Tags").Rows(4).Insert
Worksheets("Open Red Tags").Activate
With Worksheets("Open Red Tags").Range("a4:a500")
Set C = .Find(closetag, LookIn:=xlValues, LookAt:=xlWhole,
MatchByte:=True)
C.Select
Selection.Range("a1:k1").Cut
Worksheets("Closed Red Tags").Activate
Range("A4").Select
ActiveSheet.Paste
Worksheets("Closed Red Tags").Range("N4") = Date
Worksheets("Open Red Tags").Activate
Supervisor.Show
End With


Exit Sub << I added this
ErrorHandler: << I added this
MsgBox "Please enter a valid Redtag ID" << I added this
Resume Next << I added this

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error handler linto Excel Discussion (Misc queries) 1 February 11th 10 12:17 PM
Error Handler sharad Excel Discussion (Misc queries) 1 September 17th 07 06:38 PM
Error Handler Not Working Bill Excel Discussion (Misc queries) 0 August 25th 05 07:13 PM
Error Handler dht[_2_] Excel Programming 5 August 19th 04 08:51 AM
Error Handler Not working 2nd time Todd Huttenstine Excel Programming 3 May 18th 04 09:37 PM


All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"