Copy from one source file into multiple excel files - All live in one location

babar2019

Board Regular
Joined
Jun 21, 2019
Messages
93
Hello ,

I have an excel file which is the source document and I have other excel files which are destination files all in one location.

- I want VBA to open the source excel and Format the Date in Column C of the source to MM YYYY.
- Check if column A has the word 'SIGNAPAY' ,
- If true then open a document called 'In process SIGNAPAY.xlsx' from that location,
- Click on the sheet name which matches with Column C (MM YYYY) of the source excel.
- Copy rows through columns A:G in the source excel for all rows which have SIGNAPAY in column A and paste into the last empty rows in the 'In Process SIGNAPAY.xlsx' workbook.

Below is what the data would look like:



DMTITLDHACCTDHDATEDHDATCDHITCDHAMTDESC1DESC2
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx20191897081955259TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx20191897081955499TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx201918970819552795.81TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx201918970819556000TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx201918970819556500TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx20191907091955114TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx20191917101918834.47TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx201919171019181590.7TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx201919171019182609.02TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx201919171019183294.32TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx201919171019184632.49TestingTest Company
SIGNAPAY LTD IN PROCESS ACCOUNxxxxxxxxxx201919171019186667.57TestingTest Company

<tbody>
</tbody>

 
HAPPY NEW YEAR... :)

I just gave it a try with the above code and It prompts for every single file actually which is a little bit cumbersome to the user.

Also, when I input the first business day as 010220, it did not copy paste the last month's data into the new month's tab. It just copy/pasted today's data into the 0120 tab.

As I mentioned earlier, I think it would be better to add a one time message box at the beginning of the macro asking '‘Do you want to roll over the month end data?’ with a Yes or No option.

If selected Yes, then the macro will simply copy paste last month's data into the new months's tab. In this case, it will copy 1219 over to 0120 tab and additionally add the new data into the 0120 tab.

If selected No, the macro will simply skip the roll over process and just run the file for today and copy paste into the current month's tab.

Basically the logic should be based on if the user will select Yes or No.

Thank you..
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,215,140
Messages
6,123,269
Members
449,093
Latest member
Vincent Khandagale

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
Back
Top