macros

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

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Macros

Macros

resolvedResolved · Low Priority · Version 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:

Using Excel's MODE function

Use Excel's MODE function to display the most common value present in a particular range of cells.

The Mode function looks like this:

=MODE(cell range)

As an example, if 35 is the most commonly recurring number in a particular cell range, then the function will display 35.

View all Excel hints and tips


Server loaded in 0.08 secs.