Share via


Novice Challenge 7: Switcheroo

Office Programs Required

Microsoft Excel 2007

Goldfish Awarded

10

Deadline for Submission

Wednesday, April 29, 2009 (8:00 AM Pacific Daylight Time)

Files Required

NoviceChallenge07.xlsm in the OfficePalooza Challenge Pack.

When you put data into a worksheet in Microsoft Office Excel you have some decisions to make. One big decision is how to display your data in that worksheet. For example, does it make more sense to have headers in column A with data following in the rest of the row? Or would the data be more readable if you put the headers across row 1 with the data following in the columns below?

In this challenge we decided to start with data in columns, like this:

Name

Breed

Bailey

Mix

Rover

Labrador

Spot

St. Bernard

This is nice, but what would it look like if we were to put the names and breeds reading across? Something like this:

Name

Bailey

Rover

Spot

Breed

Mix

Labrador

St. Bernard

That’s what you’re going to find out. To successfully complete this challenge, you need to take the rows and columns from worksheet 1 (Sheet1) and copy them to worksheet 2 (Sheet2) as columns and rows.

Last but not least, you need to make Sheet2 the active worksheet so you can see your results.

Important: Although we’ve formatted the data on Sheet1 to look nice, you don’t need to worry about formatting on Sheet2. As long as you turn the rows into columns and columns into rows – and make Sheet2 the active worksheet – you will have successfully completed this challenge.

When you open the Visual Basic editor (which you can do by pressing Alt+F11), there should already be a window open with the subroutine RowColumnSwap showing. Insert your code into this subroutine. (If you don’t see this subroutine, double-click on ThisWorkbook in the Project pane on the left under VBAProject (NoviceChallenge07).) Do not create any other subroutines – all your code should go in here.

Important: Do not add code to save the spreadsheet.

Submitting Your Entry

The OfficePalooza sweepstakes is over, but you’re welcome to try the challenges and learn on your own. Good luck!