VBA help, creating a macro!!

mccaco

New Member
Joined
Aug 27, 2014
Messages
8
Hi I want to create a button on an Excel spreadsheet which will go into a folder, open up the most recent excel file. Add together several cells in that file (B12,B13,B14,I8,I13) then display the answer in the spreadsheet which contains the button (in cell J3).

I've already started the code and i've managed to open up the most recent file in the folder. As I am new to VBA I am struggling to finish off the second half of the code.

I will be grateful for anyones help.
 
I want to change what the macro does so that instead of adding together the cells and displaying the value in the other workbook, it will copy a table in sheet 2 from the workbook just opened by the macro, and paste it into sheet 3 of the workbook which contains the button then closes the opened wb.
When first learning VBA, a great tool is the Macro Recorder. If you turn on the Macro Recorder and record yourself performing the steps manually, you will often get most of the code you need. At the very least, it gives you the building blocks for a good start.

Why don't you try that, see how far you get, and post back here (with your new code) if you get stuck?
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,216,774
Messages
6,132,651
Members
449,741
Latest member
Category5Grizzly

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