Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

macros

ResolvedVersion 2003

Pete has attended:
Excel Advanced course

Macros

How do you "step" macros? i.e. I want to open two files and then interrogate the data, but the files are updated and named differently each week, so I want to have the macro ask for the correct files each time.

RE: Macros

Hi Pete, thanks for your query. You can't really do this using the macro recorder, it involves getting the computer to display the open file dialog box, allowing the user to select the filename required and then passing that to a variable. Unless you're going to tweak the actual code, it's best to open the two files yourself first and then run the macro on the open files.

If you're interested, Google the Excel VBA OpenDialog method for a tutorial on using that object method in your code.

Hope this helps,

Anthony

Mon 10 Jan 2011: Automatically marked as resolved.

Excel tip:

Adding date and time

Here are two quick ways to add the date and time to your spreadsheet:

1) Type =NOW(), which displays both date and time in the same cell
or
2) Hold Ctrl and type the colon (:) into one cell for the date and the semi-colon(;)into another for the time.

Note that =NOW() updates to the current date/time whenever the spreadsheet recalculates.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.