Both of these replies are using VB code. It's a way to automate tasks
(Macros) and to do lots of things that can't be done with worksheet
formulas. If you Google 'Excel Macro' you'll find lots of tutorials etc.
It's a bit daunting at first but it does get easier when you use it a bit
more and gain experience.
To make the code that was posted work, in a new worksheet, (Book1) :-
Go to 'Tools' on the toolbar, select 'Macro', select 'Record New Macro'
In the box that appears look for 'Store macro in'
In the dropdown list that says 'This Workbook', select 'Personal Macro
Workbook' > OK
Click the blue square that says 'Stop Recording'
The purpose of this is to create your Personal file that's available in all
of your workbooks. Any macro stored in here is available to any workbook,
one stored in 'This Workbook' is only available in the particular workbook
you put it in.
Now press Alt and F11 together, what you can see is the VB editor.
Top left under the toolbars you'll see 'VBA Project(Book1)'
Below that is 'VBA PROJECT(Personal).xls
Just underneath this is 'Microsoft Excel Objects
Click the + sign to expand the folder and you see 'Sheet1(Sheet1)' and below
that 'ThisWorkbook'
Double click 'ThisWorkbook' and in the large empty window in the middle of
the screen, copy the code I posted and paste it in. Make sure the message is
in full screen mode to avoid any text wrap.
Press Alt and F11 again to close the VB editor.
Save the file.
Now put a few numbers in a few cells and select them all by holding down
Ctrl while you select them, you should see the information on the status
bar, bottom left.
Regards,
Alan,