eHow launches Android app: Get the best of eHow on the go.

Looping in Excel

Video Preview
From Quick Guide: Excel 2007 Basics

Summary: Looping in Microsoft Excel allows users to automate the entry of data into columns and rows. Learn how to create a data loop in Microsoft Excel using the tips from a software developer in this free video about computer technology.

Views:
367
Presenter
By Dave Andrews
eHow Presenter

Dave Andrews is a software developer with a business and Web site selling programs and other computer services in Franklin, Tenn. Having worked in the IT industry for more than 8...read more

Post a Comment

Post a Comment

Video Transcript

"Hi, my name is Dave Andrews. Today I'm going to show you how to use looping in Excel. Let's open up Excel by clicking on the start button, go to all programs, Microsoft Office and selecting Excel. Now here's our default Excel spreadsheet that opens up. What I'm going to do is create a loop that will fill in several columns and rows here with data. To do so, let's hold down the alt key on our keyboard and press F11. This opens up the Excel code viewer, that's visual basic. Double click on sheet1 to open the code for d for sheet 1. Next to general, let's select worksheet and then under selection change, let's change it to say, activate. Now we're going to begin typing in our code here. Here we have our completed function. The very first thing I've done is I've created a variable called ws, that's going to point to our worksheet. I've created two integers name row and col for rows and columns. First we set ws variable to point 2 worksheet, sheet 1. Here's where our looping comes into effect. We create a four loop that says, loop row from 1-5 and then for each row, 'cause it's nested inside of this loop, loop col from 1-5. So rows are going to go from 1-5 and columns are going to go from 1-5 and for each row, you're going to go through five columns. This running code right here sets the worksheet so that's in the row that you're currently working with and the column you're currently working with to say, "hello". Now this is in the worksheet activate function. So let's go back to Excel and to activate our worksheet, all we have to do is change down here at the bottom to sheet 2 and then we're going to change back to sheet 1 to activate it. As you can see our "hellos" have been populated. My name is Dave Andrews and I've just showed you how to use looping in Excel."

eHow Article: Looping in Excel

Related Ads

  • Have you done this? Click here to let us know.
Computers
Alexia Petrakos,

Meet Alexia Petrakos eHow's Computers Expert.

Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

eHow Computers
eHow_eHow Technology and Electronics