Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi to all,
I have got some code that copies cells from one sheet to another, if there is a duplicate a message pops up stating that there is a duplicate and exits the macro, my problem is that if the data isn't duplicated, the message box still pops up: MLRow = 4 'MasterList Start Row Do Until ThisWorkbook.Sheets("Data Base").Cells(MLRow, 3) = "" If DBWks.Cells(MLRow, 3).Value = NewFormWks.Cells(7, 4).Value Then MsgBox ("Duplicated Record: " & vbNewLine & vbNewLine & "Contract Number: " & _ NewFormWks.Cells(7, 4).Value & " already exists") NewFormWkbk.Close Exit Sub MLRow = 5 Exit Do End If MLRow = MLRow + 1 If DBWks.Cells(MLRow, 3).Value = "" Then DBWks.Cells(MLRow, 2).Value = NewFormWks.Cells(5, 7).Value 'Division DBWks.Cells(MLRow, 3).Value = NewFormWks.Cells(7, 4).Value 'Contract No End If Loop How can I stop this from happening? Any help will be welcome. Thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
AutoRun Macro with a delay to give user the choice to cancel the macro | Excel Programming | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |