VBA to avoid duplicate row entries in Masterfile with Msgbox

NewUserPri

New Member
Joined
Sep 25, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi People,

I am new to VBA and got stuck in the middle of the project. I will state the whole scenario below:-

So, I have two workbooks namely 1) DailyData 2) MasterFile (This file includes data for all the dates for a month)
I used to transfer whole data from DailyData to MasterFile using VBA code but the problem arises when the data gets transferred twice or thrice mistakenly by clicking on the activebutton.
Please help to avoid this issue and get me a solution by leveraging and using MsgBox warning statement for this.
I want copied data from DailyData to compare data present in MasterFile if it's duplicate then stop the code and exit sub with a msg data already present in masterfile else if data is partially present then add new data in masterfile and donot copy already present data and third if data is not present then paste the whole new data available to masterfile.

Please help if anyone knows how to work through this. I hope you guys get my point if not please feel free to connect by commenting the issue..
Hoping for positive replies. Thanks in advance...
 

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
10,238
It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach a screenshot (not a picture) of the DailyData sheet and the MasterFile sheet. Alternately, you could upload a copy of your two files to a free site such as www.box.com or www.dropbox.com. Once you do that, mark each file for 'Sharing' and you will be given a link to each file that you can post here. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).
 

Watch MrExcel Video

Forum statistics

Threads
1,127,785
Messages
5,626,869
Members
416,208
Latest member
tan21

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
Top