Friday, October 12, 2012

How to Use Excel to Make a Queue


1. Open a new Excel 2010 spreadsheet. Click the 'File' tab at the top of the screen and choose 'Options' on the left side of the screen. Select 'Customize Ribbon' from the left side of the new window. Find the 'Developer' listing on the list on the far right side of the window. Click the check box next to 'Developer' to add a check and click 'OK.'
2. Select cell 'A1' and type in 'Name.' Select cell 'B1' and type in 'Time.' Click the 'B' at the top of the second column. Right-click anywhere in the column and choose 'Format Cells.' Select 'Time' from the list on the left side of the window. Select the option that says '*1:30:55 PM' and click 'OK.'
3. Click the 'Developer' tab at the top of the screen. Click the 'Insert' button in the 'Controls' area of the ribbon. Click the 'Button' icon in the top-left corner of the small field of icons that opens up. Move your mouse over the spreadsheet. Click and hold the mouse button and drag it down and to the right. Release the mouse button to create a button on your spreadsheet. Type 'Add' into the 'Macro Name' field and click the 'New' button. The VBA console will open up automatically. Click the 'Minimize' button to get this window out of the way for now.
4. Click the 'Insert' button again and repeat the process. This time, name the macro 'Remove.' The VBA console will come up automatically again.
5. Click on the line between 'Sub Add()' and 'End Sub' in the VBA console. Enter the following text into the console:Rows('2:2').Insert shift:=xlDownRange('C1').CopyRange('A2').PasteSpecialActiveCell.Offset(0, 1) = NowRange('A:B').Sort Key1:=Range('B1'), order1:=xlAscending, Header:=xlYesThis code will take a name from cell 'C1' and add it to the queue.
6. Click on the line between 'Sub Remove()' and 'End Sub.' Enter the following text into the console:ActiveCell.EntireRow.DeleteThis code will delete the selected row from the queue. Click the 'X' in the top-right corner of the console to close it and go back to your Excel spreadsheet.
7. Click the 'Design Mode' button on the toolbar. Right-click the first button you created and click 'Edit Text.' Delete the text in the box and type in 'Add.' Do the same thing for the second box and type in 'Remove.'
8. Type in the name of the first person or thing you want to enter into the queue into cell 'C1.' Click the 'Add' button. The name will appear in column 'A' and the current time will appear in column 'B.' When you want to add another person to the queue, change the name in cell 'C1' and click 'Add.' When you want to remove an entry from the queue, just click on the name in column 'A' and click the 'Remove' button.

Blogger news