Saturday, 25 July 2009

Mouse Pointer Won't Move - Clean the Mouse!

If you have a mouse that has a ball underneath rather than a red light then you are going to have to clean it every now and then.

A lot of computer users get confused when the mouse pointer starts to stick, move in jerks, or fails to move at all despite them running the mouse around the desk like a maniac.

What has happened is that the rollers that the ball presses on to convert the movement into electrical signals have got covered in grease and dust and the ball is slipping on them instead of rotating them.

Turn the mouse over and you will see a plate covering the ball which can be unscrewed by applying pressure with a finger to each side and turning anti-clockwise about a quarter turn.

Turn the mouse back over and the plate and the rubber ball should drop into your hand.

Inside the ball cavity are two long rollers that will be covered in a certain amount of gunge and grot! Look at the spot in between the two rollers and opposite that spot will be a small spring-loaded roller that keeps the ball pressed to the two larger rollers.

Now it's a matter of scraping off the covering of grease and dust, rotating the rollers a little at a time until they are clean all the way round. You could be slightly amazed at the amount of greasy fluff you have to remove! It is caused by the mouse rolling over areas where you have previously rested your hand and the skin's natural moisture mixes with dust to form this material. Clean the small spring-loaded roller too - this is a bit more difficult because the pressure of your finger makes it retreat into the body of the mouse against its spring!

Once you have cleaned the rollers, use a small paint brush to clean the ball cavity.

The ball itself probably won't need cleaning but in extreme cases it can be cleaned by brushing it with a slightly stiffer brush. Don't be tempted to wash or wet it. Clean Blue Tack can be useful to pick off bits, but make sure you don't leave any shreds of Blue Tack on the ball.

Before putting the ball back, clean off any debris and grease from the underside of the mouse casing - the feet and around the edges of the label.

Lastly drop the ball back in, taking care not to handle it unnecessarily - you'll just transfer more grease onto it - and then place the retaining plate back over it, aligning the lugs and twisting clockwise to secure it. Your mouse should now work perfectly for another couple of weeks or so!

Wednesday, 22 July 2009

Excel: Manipulating text with LEFT, RIGHT, LEN, FIND, IFERROR

This entry solves the problem of having a single field for someone's name in a spreadsheet but then wanting to split it into forename and surname - perhaps because you want to sort rows alphabetically by name - hmm... yes... there's another entry to come!

This one was suggested by a colleague, Patrick Bellis and he did actually provide a solution as well. I've had a fiddle and come up with an enhanced version though that shows how to deal with entries that have two forenames or a middle name or initial. It doesn't deal with more than one middle name or initial although you can do that easily - details later!

So in my simple example, the Full Name field was the previously existing field and I have used formulae to split this into the two new fields, Forename and Surname.

Now I have to say that this isn't my preferred way of doing this. My preferred way would be to use a Visual Basic (or VB) routine in a macro, but whilst these work for me quite easily in MS Access - the database application that comes with Microsoft Office Professional, I've never managed to get VB macros to work in Excel even when my efforts look exactly like the example in the Help pages. Someone else will have to suggest a fix for that perhaps?

The VB routine would allow me to search for the last space within the name field. Using a simple formula, we have to search for the first space and that's why there's a problem with people who have middle names.

To get over this partly - more specifically to deal with people who have a single middle name or initial - I've used a third new column which I've placed over to the right, out of the way where it doesn't need to be seen or printed. It's doing nothing other than an interim calculation or manipulation of the Full Name field.

I've left a blank column between the working bits of the spreadsheet and this interim field but in reality you may want to hide it away far over to the right - say in column Z or even ZZ!

This interim field searches for the first space and will contain all the text that comes after that first space.

But before we look at the formula for that field let's deal with the simplest formula - that for the Forename field. Before we even do that let's look at the common syntax (the use of characters and the order they must be used) that formulas in Excel have.

Any formula starts with an equals sign (=). This tells Excel that we want it to calculate something rather than treat the following characters as a string of text.

Many formulas use brackets (or parentheses to give them their posh name) to contain any parameters the formula needs to work and use commas (,) to separate each parameter. The formula name tells Excel what to do and the parameters tell it what to do it to and how. A bit like:

=DO-THIS(Do it to this, Do it like this)

Formulas can be nested. That means we can use one formula to calculate the parameters for another formula. To find the Forename from the Full Name we need a formula that does this:

RETURN THE CHARACTERS(from the Full Name, until you reach a space)


For the Forename in Row 3 (so in the cell C3) the formula is:

=IFERROR(LEFT(A3,FIND(" ",A3,1)),"")

There are three different functions here and as with all mathematical formulae you should start by understanding the innermost set of brackets first.

That set contains the parameters for the FIND keyword. The FIND formula counts the character that contains the first character of the string we want to find (the example will make this clear). The syntax for FIND is:

FIND(the string of text you want to find, the string of text you want to find it within, the first character within the original string that you want to start searching from)

Whoa! Too Much! Don't panic yet - I'm about to explain step by step.

Step 1. The string of text we want to find is a space. So in the actual formula a few lines up you see ...FIND(" "...

Step 2. The string of text we want to find the space within, is the Full Name field. So instead of actual text we have a pointer to cell A3. So far we have explained ...FIND(" ",A3...

Step 3. I've put a figure one - 1 - because I want to start searching from the first character. Now; you could argue that there shouldn't be a space until at least the second character so I should have used a 2. But whilst there shouldn't that doesn't mean there won't be a space as the first character. Someone might have wanted to put their first initial and then their surname but not pressed the initial key hard enough. So by using a 1 instead of a 2, we do a simple bit of error trapping.

So that should explain ...FIND(" ",A3,1)... The result of that bit of the formula is the number of the character that contains the space as counted from the left. So as cell A3 contains the text "John Burke" the FIND formula should find the space in character 5 and that is the "result" or "return" of the FIND formula. In the next cell down when considering the string "Seamus O'Leary", the space is the 7th character so the FIND formula returns 7.

Thus as we consider the next most inner bit of the formula - which is the LEFT keyword - I can simplify the formula for you.

Instead of considering:

LEFT(A3,FIND(" ",A3,1))

we can consider it as:

LEFT(A3,5)

because Excel calculates the innermost formula first and works outwards, so once the FIND formula has run the LEFT formula works using the result.

The LEFT formula chops and returns the text from the start (left) of the target string depending on how many characters you want. The syntax for LEFT is:

LEFT(a string of text, the number of characters starting at the left of the string that we want to use)

Again the string of text we want to use is contained in cell A3 so we have LEFT(A3... and the number of characters we want to use (as calculated by the FIND formula) is 5. So LEFT(A3,5) is the same as LEFT("John Burke",5) and the result is "John ". Note that there is a space at the end, because we asked for 5 characters. It won't show so it doesn't matter, but if you wanted to be pedantic (anyone having problems with the formula should ignore this as over complicated) we could have used LEFT(A3,FIND(" ",A3,1)-1) which would have subtracted 1 from the value returned by the FIND.

Ahem! But that's just being a clever clogs!

So that just leaves us with the IFERROR bit of the formula and what that does is it stops Excel from coming up with an error message if there is no space at all.

Basically the syntax for IFERROR is:

IFERROR(I want Excel to do this, but if it finds an error then do this instead)

In the last parameter I've used two double quote marks "" - or in other words I've told Excel that if there is an error, instead of reporting that there's been an error it can show the text within the quote marks. Which is nothing. No text at all. The cell would be empty. Excel isn't good at telling you what's wrong; it just tells you there has been an error.

Without the IFERROR formula if there is no space at all then you just get the dreaded #VALUE! error, which tells you absolutely nothing! See Row 7 in the screen grab.

And so to the surname... Unfortunately there is no way of saying 'Now take the rest' after having done a LEFT formula. But there is a RIGHT formula which does the same as the LEFT only from the rear of the text string.

RIGHT(a string of text, the number of characters starting at the right of the string that we want to use)

Our problem now is that just because we know the position of the space, that still doesn't tell us how many characters we want from the right hand end of the Full Name, because we don't know how many characters there are in the surname.

So we need to know how long the entire string of text is and to do that we use the LEN formula:

LEN(a string of text)

The LEN formula only needs a single parameter and returns a number which is the number of characters contained within the string.

LEN("Fred Bloggs") would return 11. (it's counting the space as a character don't forget)

LEN(A3) returns 10 - because cell A3 contains the text "John Burke"

What we need for the Surname is the length of the Full Name minus the length of the Forename.

So including our error trap use of IFERROR in case there is no space character, our formula is:

=IFERROR(RIGHT(A3,LEN(A3)-FIND(" ",A3,1)),A3)

Break it down from the innermost formula(s) in the nest. That's LEN and FIND. Both return numbers and we are taking LEN formula and then subtracting the result of the FIND formula. That gives us the number of characters to be returned by the RIGHT formula and as long as there is a space existing in cell A3 then we have our final result.

The IFERROR formula this time, instead of returning no text at all, returns all of the Full Name field - assuming that any text with no spaces will be a surname. You can change this round if you keep a spreadsheet of celeb names such as Madonna or Prince!

IFERROR(the main formula,A3)

Now I just need to explain the interim field. The nested formula for the Surname as described above would take everything from the first space. So if there is a middle name or initial then you get that plus the Surname. I've created an interim field with the formula just described and then the Surname field has a formula that is exactly the same but which takes its original text string from the interim field instead of the Full Name field.

You could have as many interim fields as you want, each whittling a middle name or initial out of the final surname, and with no errors even if there is no middle name.

12 such interim columns would let you deal with those unfortunate people whose father named them after the long-forgotten football team in the 1960s or 1970s!

Tuesday, 7 July 2009

Excel: Merge Cells and Multiple Lines in Cells

A couple of related formatting tricks that you can use within a spreadsheet this time.

Let's start with a look at a standard bit of data.

Column A holds the collective heading - the people in Column B in the first four rows belong to Team A and then Team B personnel are held in rows 5 to 8.

We could just repeat the descriptive header by selecting cell A1 and copying it down to the next three rows. But it then starts to become less clear because there is too much confusing text.

So instead we'll merge cells A1 to A4 together as a single cell. In Excel a range of cells is written using the syntax A1:A4 - the colon means "through to".

So we need to select the four cells by clicking into A1 and then click and dragging until the range A1:A4 is selected.

Then we select the Merge & Center whilst tutting slightly at the American spelling and hey presto, the four cells become one whilst at the same time the text has been centred in the horizontal plane. The text though has moved to the bottom of the new cell, to the spot previously occupied by cell A4.

This is because Merge and Center (tut!) is more often used to merge cells next to each other horizontally - grouping a number of column headings for instance.

We can do a couple of things now to format that and they include centring (darn it - the American spelling would look better there...) the text vertically and twizzing it round (Lancashire/technical term for aligning it vertically).

Select cell A1 (the merged cell still has that designation) and right-click the mouse to bring up the dialogue box shown.

Now select Format Cells.

The resulting dialogue window allows us to format lots of things but for now we are interested in the Alignment tab (pointy hand 1).

We can alter the text alignment to centre the text both horizontally and vertically (pointy hand 2) and we can twiz (or is it twizz?) the text (pointy hand 3).

Having clicked the Ok button and resized the cell by double-clicking the right cell wall to get the best fit the result is as shown below.

The pointy hand shows the simple way of aligning text left, right or centred in both horiziontal and vertical planes. The AB button with the little arrow to the right of the pointy hand can be used to twiz text - it opens the same dialogue box we have just used.

That's one way of doing it. Here's the other - which may appear simpler, but may not meet your needs. It's always good to have an alternative!

If whilst typing the names of the team members we used the ALT-Enter key combination we can force cell B1 to accept multiple lines within the single cell.

So we type John Tharmy then hold down the ALT key and whilst it's held down, tap the Enter key. Now without moving from the cell type Sally Vaite and use ALT-Enter again until we read the last name. Now tap the Enter alone as you would normally do and the list of names each occupy a line within the single cell.

Job done!

Friday, 19 June 2009

Excel: Keep Headings in View Whilst Scrolling

A question I've been asked a few times is how to keep headings in view when you scroll down or across a large spreadsheet.

Here I've got a spreadsheet that records the number of views my photos get daily at my Flickr account. Every day I look at the stats on my account and in the spreadsheet I enter the number of views per day and the number of photographs I have stored there. From these two pieces of information the spreadsheet can work out the total number of views by adding the total from the previous day to the daily number of views and the average views per photo by dividing the total views by the number of photos.

However over the course of a year or two there are so many entries (days) that the column headings would normally disappear off the top of the screen when you scroll down.

To stop this happening I've used the Freeze Panes function of Excel to stop the top two rows from scrolling. Those two rows contain the headings and remain on screen whilst the rest of the rows scroll.

To start, select the cell underneath and to the right of the rows and columns you want to keep in view. In my example I only want to freeze the top two rows, not any columns at the left, so the cell I've selected is A3.

Then I select the View tab from the menus at the top.

Finally I select one of the options from the Freeze Panes icon.

Note that once you have frozen some headings, the options change to include an Unfreeze option.

Now I can scroll down as far as I need to and can still see the column headings.

Monday, 11 May 2009

Adding Pictures to a Word Document

Have you ever looked at a book containing photos and thought, "I'd like a book of my own photos"?

Well with Microsoft Word, inserting photos or pictures of any kind into a document is very easy. However, there are a few things you should know. You can very soon use up a lot of the memory in your computer doing this, so let's have a look at how to create your book, but not let the computer run out of memory.

First of all let's understand what I mean by the word memory. It's easier to begin with what I don't mean. I don't mean the disk space or storage space - the disk drive where you computer stores your information and documents when you save them. What I mean is the internal memory of the computer, known as the RAM, that it uses to temporarily store all the things you are currently doing and all the things the computer is doing by itself in order to work.

When the internal memory gets too low the computer slows down, because it runs out of space to carry out its normal functions; like checking the keyboard to see if you've pressed a key. It slows down because if the memory is too full it has to save a bit of information to the temporary space on your disk drive so it can load back the bit of information it needs to check the keyboard and then it can forget that bit again and go back and reload the information it saved to the disk - until it is time to check the keyboard again. It checks the keyboard a lot... That's a silly example but it helps to illustrate my point.

The next thing you should know is that when you open a piece of software, whether it's Word, Excel or you open a program to play music on the computer in the background whilst you're working, the software takes up a part of the internal memory of your computer. That's before you open any documents or music files.

Opening a document uses up another chunk of internal memory the size of which depends on how large the document is. So opening lots of documents at once uses up more and more memory until you start to close them.

Now, let's get back to our photo book. We open Word, which takes up a bit of memory and then we open a document which takes up a bit more. Every time we type a letter the document size increases. And every time we insert a photo it increases by a lot. So what we need to do is keep the overall size of the document down so that the computer doesn't start to run slowly. If it runs out of memory altogether the computer will freeze or crash and you may be forced to switch it off and on again - which will lose any work you haven't saved.

If we were going to have a book with 300 pages each containing a couple of photos and some text describing what was on each page you would need to split the book into several documents. When they are printed out you can combine them all together again so by saving, say, 10 or 20 pages to a document and having 10 or 15 documents as parts or chapters of the book, you would be certain that the computer would not run out of memory.

But we can do even more than that.

First let's go and find a picture on the Internet that we want in our book. You should note that there is copyright on every photo on the Internet so you may need to ask permission or find one that already has permission granted for you to use it.

So I'm going to use one of my own here and it's stored on my account at Flickr. I allow anyone to download my photos but they cannot be used for profit (which means no publishing by a profit-making organisation or use for advertising), they must be attributed (you have to say that it was taken by John Burke) and you cannot alter the photos in any way.

There are several ways to insert the photo into a Word document so I'm going to do the same thing in several ways and then save the document each time and then we'll have a look at the size of those documents.

First we'll open a Word document and type some text which will be the same text in each document.

For the first document I'm just going to go to the Flickr page, right-click the photo and copy it and then go back to the Word document and paste it after the text. Then I'm going to save the document with the name tram photo 1.doc. It is 150 Kilobytes in size (150KB).

Now I'm going to open a new Word document and type exactly the same text but this time instead of copying and pasting the photo, I'm going to right-click the photo on the Flickr website and choose the Save Picture As... option and save it to my hard drive.

Then I'll insert the picture from my hard drive by choosing the Insert tab in Word and clicking the picture option. If you have an older version of Word, click the Insert menu, then choose Picture and then from file....

You can now browse to find the file you saved and choose that. It will be placed into the Word document where your cursor point (the mouse icon) is.

It looks bigger than it did when we pasted it, doesn't it? Never mind, we'll now save this document as tram photo 2.doc. It saves as a file 150KB in size - exactly the same as copying and pasting!

Just to keep the documents the same I'll click and drag the photo to shrink it to the size we had before. Even better - I'll right-click the picture in the first document and find out exactly how big it was and alter the picture in the second file to be exactly the same size.

Then I'll save it again as tram photo 3.doc. It saves as a file 150KB in size - exactly the same as when the photo was bigger. So that means if we used a really big photo from the Internet but wanted it small in the book, it would still be adding a hefty size to the file.

There must be a better way of doing things. Perhaps if we used a photo editing piece of software to re-size the picture down to the size we wanted before inserting it? You can use any software you like. Common photo-editing software include Adobe Photo Shop and Paint Shop Pro. Both have their supporters. I have used Paint Shop Pro for years - it came as an old version on the front of a magazine for free...

If you have none, then Windows has something called Paint that will do the job. You find it from the Start menu, All Programs and then Accessories. Open it and the copy the photo from Flickr and paste it into Paint.

Drop down the Image tab and choose Resize/Skew. A bit of experimenting with the sizes will soon tell you what size your photo needs to be. Then go back to the Image tab and select Crop. Then save the photo somewhere on your hard drive making sure that you save it with a filetype of JPEG which compresses the filesize of the image.

Now I'll go back to Word and open a new document and type exactly the same words in again and now I'll use the Insert tab to insert the saved photo from Paint. I resized it to exactly half the original width and height by the way, which makes the picture 1/4 of the original size.

If you see something like this when you insert the picture...

...you forgot to crop the photo or you clicked the mouse somewhere to deselect the area of the photo before you cropped. When you resize the photo it simply makes the picture smaller but in an area equal to the original.

And the proof of the pudding finally is here in a look, using the detailed view of Windows Explorer, at the folder where I saved all the files including the photos.

Those file sizes are fairly small but if you start adding photos that have been saved straight from your camera they can be huge. Add a dozen of those to a Word document and the filesize just keeps adding up - and taking the internal memory of your PC.

In a future entry I'll show how to wrap text around the photographs. Start creating your memoires now! Before your own memory goes...!!!

Wednesday, 11 February 2009

Creating and Renaming Folders

We've had a look at the program called Explorer before in the article Seeing what's on the computer.

It can be opened from the Desktop by clicking either of these two icons - obviously you won't have one called Burke, John but it may have your own name or your user name or on older computers may be called My Documents.

You can also open Explorer by holding the Windows key down with your thumb and tapping the E key with your finger. This can be a very useful thing to remember!

Let's start by going to the folder where we want to create the new folder. Once you are there, any content already in the folder should appear in the right hand window of Explorer.

There's almost always more than one way to do something but let's start with the one most people are familiar with - the File Menu.

In Windows Vista the default is for the menus to be invisible. If this is so you can still bring them up by holding the Alt key down with your thumb and tapping the first letter of the menu name with your finger. So for the File menu hold down Alt and tap F. You will see this written down as ALT-F. For the Edit menu you would ALT-E and so on. Remember that this tip will work in any software, not just Explorer.

Under the File menu click on New which will then open up a new window and then click Folder as shown.

But that's the hard way! And there are two other ways of doing the same thing!

You can move the mouse pointer to a white area in the folder where you want to create a sub-folder and right-click. Then choose New and then Folder as described above.

Or you could right-click in the left hand column on the folder name where you want your new folder creating and then choose New and then Folder.

Your new folder will appear like this with the folder name "New Folder highlighted for you to type a name for it. Note: you don't have to delete this as I've watched countless people do - just start typing and the existing text will disappear as you type the first letter of the new folder's name.

If you click the mouse anywhere else though the folder keeps its name of New Folder. You can still rename it - and any other folder - at any time as follows.

Click on the folder name to select the folder. Then you have a choice...

You can use the File menu again and choose Rename.

Or you can click on the folder once more and the name will be highlighted ready for over-typing. (Don't double-click though as this opens the folder - you have to click once to select it, pause and then click again to rename it)

Or you can press the F2 key which will highlight the folder name. This works on files too. Click once on any file or folder, press F2 and the name is highlighted for you to type a new name.

Note: if it's a file and you can see the extension (the dot and three-characters as in filename.doc or filename.exe) then whatever you do, make sure you leave the dot and the same three characters! Otherwise the file may not work.

Thursday, 5 February 2009

Email Rules in MS Outlook

If you get bothered by spam of one sort or another or even if you just want to automatically sort your incoming emails to make life easier, you can make up some rules that Outlook will then follow to direct emails to certain folders or to automatically delete them.

You will find the Rules and Alerts tool on the Tools menu.

We are going to create a new rule here, but there is also the option to edit any rules you have already created.

There are many different types of rules - we'll have a look at a longer list later, but for now we are going to create a rule to move all messages that have a specific word (or part of a word) to a certain sub-folder that we have created within our Inbox folder.

This can be done quite simply as shown below:

Point the mouse to the Inbox label (or any other folder to create a sub-folder within it) and right-click. Then choose New Folder.

Note that in the third screen shot my mouse pointer (the pointing hand) was pointing to the link for specific words. This allows me to specify the text that the rule will be based on. In fact I'm going to enter three asterisks *** as a lot of spam messages have that as an attention grabber. I could have entered an actual word or part of a word. Make sure if you enter a part of a word that it won't also match parts of other words and move emails that you may want to receive in your Inbox!

Having now entered the text that I want Outlook to base the rule on, I can now click on the link of Specified Folder.

You can see that this has opened a further window to allow me to scroll through and choose one of my existing folders.

Because it's spam that I'm searching for, I want to choose the Deleted Items folder, which is exactly the same as choosing to delete the email without even ever having to see it. Note now though that if one of your contacts or friends sends a message with the subject ***Happy Birthday!*** you won't see it!

And to end this blog entry - here's a few of the rule types you can create.