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: 26
Default MsgBox. problem to continue the macro

Hi!
Am not able to make the macro continue after an msgbox has been displayed.

This msgbox come as an warning if one cell in the column, contains the same
contents as the textbox 1 is going to insert to the same or another cell in
the column range.

I want the user to be able to do changes in the textboxes on this userform,
after the msgbox has been displayed, but it only work when it's not duplicate
contents in the range

Any suggestions?


Application.ScreenUpdating = False
Dim myStr As String
myStr = TextBox1.Text
If Application.CountIf(v, myStr) 0 Then
ans = MsgBox("This serialnumber allready exist! Press OK if you want to
continue", vbOKCancel)
If ans = vbCancel Then Exit Sub
Else
Dim iCtr As Integer
iCtr = ComboBox1.Value
Range("B" & CStr(iCtr + 3)) = Me.ComboBox2
Range("C" & CStr(iCtr + 3)) = Me.TextBox1
Range("D" & CStr(iCtr + 3)) = Me.TextBox2
Range("E" & CStr(iCtr + 3)) = Me.TextBox3
Range("F" & CStr(iCtr + 3)) = Me.TextBox4
Range("G" & CStr(iCtr + 3)) = Me.TextBox5
Range("H" & CStr(iCtr + 3)) = Me.Comboday & Me.Combomonth & Me.Comboyear

If TextBox1.Text = "" Then Range("B" & CStr(iCtr + 3)).ClearContents
If TextBox1.Text = "" Then Range("C" & CStr(iCtr + 3)).ClearContents
End If
--
Axel
Copy & paste developer
 
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
popup msgbox ok continue simple code anduare2 Excel Programming 2 April 16th 08 03:42 PM
Problem with Update Link prompt to Continue Tasha Excel Discussion (Misc queries) 0 January 30th 08 07:19 PM
macro to scroll the worksheet and continue to run macro in backgro Micah Excel Programming 2 October 1st 07 05:10 PM
VB code to continue macro Brian Excel Discussion (Misc queries) 3 May 9th 06 03:12 AM
Novice - MsgBox Yes/No - Continue if Yes, Close if No Beetlejuice Excel Discussion (Misc queries) 6 August 29th 05 09:48 PM


All times are GMT +1. The time now is 09:53 AM.

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"