I have two files one a larger report Sample Charges and Sample Dispute that I need to merge with each other. I need only two columns from dispute file( Minutes Used MSG/KB/Min/MB Used) merged with the charges file.
Any help is appreciated.
Thanks
I have two files one a larger report Sample Charges and Sample Dispute that I need to merge with each other. I need only two columns from dispute file( Minutes Used MSG/KB/Min/MB Used) merged with the charges file.
Any help is appreciated.
Thanks
Maybe this add in will help
Hello there,
Below is a code that will add the B and C columns from the Dispute workbook into columns R and S of the Charges workbook.
To insert this code go to the developer tab on the Excel menu. If you do not have it go to File --> Options --> Customize Ribbon --> and then in the far right column select the Developer option and select Okay.
Next select the Macros option. In the Macro Name: text box provided type macro1 and then select Create
Paste the below code in between the Sub and End Sub that appears.
As stated in green above you will need to change the file path in the code to the filepath you have the document saved on your computer.![]()
Dim ChargesWb As Workbook Dim DisputeWb As Workbook Set DisputeWb = ActiveWorkbook 'opens Charges workbook. You will need to replace the path below in between the apostrophes with the path it is stored on in your computer. Application.Workbooks.Open ("C:\Documents and Settings\rvasquez\My Documents\Example Spreadsheets\Sample 20Charges.xlsm") Set ChargesWb = ActiveWorkbook DisputeWb.Activate Range("B:C").Select Range("B:C").Copy ChargesWb.Activate ActiveSheet.Range("R:R").PasteSpecial DisputeWb.Activate
You're final code should look like this
Let me know if you have any questions!![]()
Sub macro1() Dim ChargesWb As Workbook Dim DisputeWb As Workbook Set DisputeWb = ActiveWorkbook 'opens Master Document. You will need to replace the path below in between the apostrophes with the path it is stored on in your computer. Application.Workbooks.Open ("your file path") Set ChargesWb = ActiveWorkbook DisputeWb.Activate Range("B:C").Select Range("B:C").Copy ChargesWb.Activate ActiveSheet.Range("R:R").PasteSpecial DisputeWb.Activate End Sub
Finally close VBA and then go back to macros and select macro1 and click Run.
Thanks!
rVASQUEZ
thank you so much! that worked like a charm! i can now avoid tedious manual merges!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks