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

How to Program in Visual Basic in Excel

Video Preview

Summary: To program using Visual Basic in Microsoft Excel, open the Visual Basic editor by holding the "Alt" key and pressing "F11," and then create a custom code to run in an Excel spreadsheet. Create and assign a macro in order to run the function in an Excel program with instructions from a software developer in this free video on Microsoft Excel.

Views:
2,234
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

Series Summary

Computers are complex machines built upon very simple principles. They perform arithmetical operations millions of times over to transform digital information moving at lightning speed into usable human data. A personal computer's job is to help a user create, manipulate, deliver, receive or delete media content. This is a simple, sterile definition that sounds uninteresting on the surface. Nevertheless, these fundamental functions mimic human ability in some surprising ways. Therefore, the computer is increasingly becoming an engine of the imagination, a platform for the digital life. In this free video series on computers, an experienced software developer explains how to work with computer privacy settings and cookies. Get information on how to delete cookies, browsing history or read-only cookies. Learn about formatting a new hard drive and get tips on cleaning a computer. Find out how to reclaim computer memory and how to make a computer go faster, all with help from an experienced software developer.

Post a Comment

Post a Comment

Video Transcript

"Hi, my name's Dave Andrews. Today I'm going to show you how to program in Visual Basic in Excel. Let's open up Microsoft Excel. We're going to click on our Start button. Go to All Programs. Let's find Microsoft Office and just launch Excel. Now, once Excel is finally opened up we're going to open up the Visual Basic editor. And the way we do this is by holding down the Alt key and we're just going to press F11 which brings up the Visual Basic editor within Excel. This allows us to create a custom code that will actually run in our Excel spreadsheets. I'm going to write a function by going to Insert. I'm going to choose Module. And as you can see here, I have a new Visual Basic Module. So I'm going to put a function in here called Run Me. That's basically what it's going to do is just be a function that we run and I'm going to begin writing a simple program here. So now that my little program is completed, as you can see here, I've created several integers here, row and column and value. I've created another object that's pointing to our current worksheet. And the way that I did that was I set it to the active workbook, sheets, and then sheet 1. Now, here I have a loop which loops from 1 to 5 both on the row value and the col value, multiples them together and stores that in value. And then within the current cell that I'm in, row and column, I say 'the value row times the value column equals' and then the result of those two multiplying together. So basically, I'm just going to do a little multiplication table. So let's close out of our Visual Basic editor and we have to have a way to make that code work. So I'm going to Insert and I'm just going to put a little shape on here that kind of looks like a button. Just like that. And I'm going to assign a macro to this button by right-clicking on it and saying Assign Macro. And we're going to create a new macro and all that macro's going to do is say module1.runme which is the name of our function. Now, if I close out of Visual Basic editor, click on my little button, here, as you can see, it's just filled in my multiplication table. One times one equals one, one times two equals two and so on here. So we can see that five times three equals fifteen and such and such. My name's Dave Andrews and I've just showed you how to program Visual Basic in Microsoft Excel."

eHow Article: How to Program in Visual Basic 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