excel training microsoft - 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 » excel training microsoft - Macros

excel training microsoft - Macros

resolvedResolved · Low Priority · Version Standard

Charlotte has attended:
Excel Intermediate course

Macros

what do you use macros for and how do you create them?

RE: macros

Hi Charlotte, Thanks for your post, Macros are used to complete repetitive tasks. They are a 'recording' of your key strokes and mouse movements, and will faithfully replay the recording when requested. To create a macro go to Tools, Macros, Record New Macro. Complete the box as necessary and press OK - as soon as you press OK you are recording and will be until you switch off the recording by pressing the blue square Stop Recording button. Be aware of the switch for Relative/Absolute Referencing to ensure the macro does not follow the same path each time you use it.

RE: macros

Thanks for the answer. However what does Relative/Absolute Referencing mean exactely?

RE: macros

Hi Charlotte, To put it in a rather large nutshell, Relative referencing is when Excel is free to follow the pattern (of the original formula) when the Fill handle is used to copy the formula. Absolute referencing can be easily recognised by the $ dollar signs which preceed either the column or row identifier, or both and is used to create a partial or total reference where a particular cell (or column or row). So if a Macro is using Absolute references it will always run in the original cells (used to create the formula), not where you might require it to run if it was referencing the cells in a Relative manner. Hope that helps.


 

Excel tip:

Use RANDBETWEEN to generate random numbers

There may be occassions where you need to generate random numbers in your spreadsheet. Use the RANDBETWEEN function to generate random numbers between two values that you specify.

The function looks like this:

=randbetween(LOW,HIGH)

where LOW is the lowest number you want generated; and HIGH is the highest number you want generated.

This formula will work with both positive and negative LOWs and HIGHs. Also it will only generate integer numbers unless forced to do otherwise by the following:

=randbetween(LOW*10^PRECISION,
HIGH*10^PRECISION)/(10^PRECISION).

where PRECISION represents the levels of decimal precision needed (i.e. if you need numbers with one decimal place, PRECISION would be 1; 2 for two decimal places and so on).

One final note, if the RANDBETWEEN formula does not work in your spreadsheet or returns a "#NAME" error, you need to install the Analysis Toolpak Add-In. You will need to press F2 then Enter following the installation.

View all Excel hints and tips


Server loaded in 0.09 secs.