Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I'm having a problem with the code stopping at the (Range("Bid_Date") = CDate(TextBox5)) line. My code was working fine until I added the lines for the description check which makes sure the user doesn't add a description in the textbox of the userform that has been previously entered. I think the problem may be with the error goto & error resume next statement. Does anybody have any insight on this? Thanks, Darrell 'CHECKS IF DESCRIPTION HAS BEEN PREVIOUSLY ENTERED '...Added description check On Error GoTo 100 If Cells.Find(What:=i, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=ylNext, MatchCase:= _ True).Activate = True Then MsgBox "The description you entered has been entered on a previous job." GoTo 200 End If 100 Range("L3").Select Cells.Find(What:=n, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByColumns, SearchDirection:=ylNext, MatchCase:= _ False).Activate Selection.Offset(0, -10).Select response = MsgBox("Do you want to add this information to another line for existing job# " & j & "-" & Format(k, "000") & "?", vbYesNo) If response = vbYes Then Unload Existing_Task Range("EII_Number") = CInt(TextBox1) Range("Seq_Number") = CInt(TextBox2) Range("Customer") = TextBox3 Range("Solicitation") = TextBox4 On Error Resume Next MsgBox Existing_Task.TextBox5 '...Stops at the following line Range("Bid_Date") = CDate(TextBox5) If CDate(TextBox5) = False Then Range("Bid_Date") = TextBox5 End If |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if your find statment does not find a duplicate entry, then it will try to
activate nothing. That will raise an error. Dim rng as Range set rng = Cells.Find() if not rng is nothing then rng.activate msgbox "something" else ' no duplicate found End if -- Regards, Tom Ogilvy wrote in message ups.com... Hello, I'm having a problem with the code stopping at the (Range("Bid_Date") = CDate(TextBox5)) line. My code was working fine until I added the lines for the description check which makes sure the user doesn't add a description in the textbox of the userform that has been previously entered. I think the problem may be with the error goto & error resume next statement. Does anybody have any insight on this? Thanks, Darrell 'CHECKS IF DESCRIPTION HAS BEEN PREVIOUSLY ENTERED '...Added description check On Error GoTo 100 If Cells.Find(What:=i, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=ylNext, MatchCase:= _ True).Activate = True Then MsgBox "The description you entered has been entered on a previous job." GoTo 200 End If 100 Range("L3").Select Cells.Find(What:=n, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByColumns, SearchDirection:=ylNext, MatchCase:= _ False).Activate Selection.Offset(0, -10).Select response = MsgBox("Do you want to add this information to another line for existing job# " & j & "-" & Format(k, "000") & "?", vbYesNo) If response = vbYes Then Unload Existing_Task Range("EII_Number") = CInt(TextBox1) Range("Seq_Number") = CInt(TextBox2) Range("Customer") = TextBox3 Range("Solicitation") = TextBox4 On Error Resume Next MsgBox Existing_Task.TextBox5 '...Stops at the following line Range("Bid_Date") = CDate(TextBox5) If CDate(TextBox5) = False Then Range("Bid_Date") = TextBox5 End If |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I appreciate it Tom. That fixed it.
Thanks, Darrell |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
On Error Resume Next problem | Excel Discussion (Misc queries) | |||
On error resume next problem | Excel Discussion (Misc queries) | |||
CDate Problem | Excel Programming | |||
VBA/XP/2000 On Error Resume Next problem. | Excel Programming | |||
On error resume next? question - problem | Excel Programming |