Professional Documents
Culture Documents
Ayushi Singhal (0902710029) Shaleen Gupta (0902710094) Dhananjay Kr. Dubey (1002710904)
Submitted to the Department of Computer Science & Engineering in partial fulfillment of the requirements for the degree of Bachelor of Technology in Computer Science & Engineering
Ajay Kumar Garg Engineering College, Ghaziabad Gautam Buddh Technical University May, 2013
TABLE OF CONTENTS
Page
ABSTRACT..................................................................................................................i ACKNOWLEDGEMENTS..........................................................................................ii DECLARATION..................................................................................................v CERTIFICATE............................................................................................................vi LIST OF TABLES.......................................................................................................................ix LIST OF FIGURES......................................................................................................................x LIST OF SYMBOLS...................................................................................................................xii LIST OF ABBREVIATIONS......................................................................................................xiii
DECLARATION
We hereby declare that this submission is our own work and that, to the best of our knowledge and belief, it contains no material previously published or written by another person nor material which to a substantial extent has been accepted for the award of any other degree or diploma of the university or other institute of higher learning, except where due acknowledgment has been made in the text.
Signature : Name :Ankur verma Roll No : 0902710018 Date :
Date :
Signature : Name :Dhananjay Kr. Dubey Roll No : 1002710904 Date :
CERTIFICATE
This is to certify that Project Report entitled (Multiple) utility based form for decentralized data collection and analysis which is submitted by Ankur Verma (0902710018), Ayushi Singhal (0902710029), Dhananjay Kr. Dubey (1002710904) and
Shaleen Gupta(0902710094) in partial fulfillment of the requirement for the award of degree B. Tech. in Department of University, Computer Science and Engineering of U. P. Technical
is a record of the candidate own work carried out by him under my/our
supervision. The matter embodied in this thesis is original and has not been submitted for the award of any other degree.
Supervisors:
Date:
Date:
ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of the B. Tech Project undertaken during B. Tech. Final Year. We owe special debt of gratitude to Mr. Akhilesh Verma, Department of Computer Science & Engineering, Ajay Kumar Garg Engineering College, Ghaziabad for his constant support and guidance throughout the course of our work. His sincerity, thoroughness and perseverance have been a constant source of inspiration for us. It is only their cognizant efforts that our endeavors have seen light of the day. We also take the opportunity to acknowledge the contribution of Professor B. M. Kalra, Head, Department of Computer Science & Engineering, Ajay Kumar Garg Engineering College, Ghaziabad for his full support and assistance during the development of the project. We also do not like to miss the opportunity to acknowledge the contribution of all faculty and staff members of the department for their kind assistance and cooperation during the development of our project. Last but not the least, we acknowledge our friends for their contribution in the completion of the project.
Signature : Name :Ankur Verma Roll No :0902710018 Date : Signature : Name : Ayushi singhal Roll No : 0902710029
Date :
Signature : Name :Dhananjay Kr. Dubey Roll No :1002710904 Date : Signature : Name :Shaleen Gupta Roll No : 0902710094 Date :
ABSTRACT
The project titled Multiple utility based form with de-centralized data collection and analysis aims to showcase certain basic concepts of VBA by successfully applying these in automation of usual office works. Our main objective is to develop educational software cum model which helps to use the data management approach which is available both online as well as offline for the user and also provide hands-on interactive experience to enhance understanding and knowledge of these powerful methods.
In most of the offices in varying domains the database are maintained largely within Excel sheets. Sometimes though, despite the rich set of features in the standard Excel user interface (UI), one might want to find an easier way to perform a mundane, repetitive task, or to perform some task that the UI does not seem to address.
Institutions like ours require manual updating of data and analysis henceforth. Fortunately, Office applications like Excel have Visual Basic for Applications (VBA), a programming language that gives us the ability to extend those applications. There are numerous domains where such an application can be used fruitfully and easing the maintenance and analysis of data. The application provides an interface that updates locally stored database (Excel File).
The difference in our application and traditionally used web based applications is their reliability on the availability of a working internet connection before any updating or addition Thus the limitation lies in its roots, i.e. No Internet Connection means No Work.
While these limitations may be resolved to a huge extent using our application where all the data is stored on Google Cloud (using Google Drive) and is required to be synchronised only on the first use or when an updating is done. That too happens automatically as soon as the working connection to internet is available. While in case of Internet unavailability the modifications and analysis can be done on the local level using a friendly user-Interface with VBA - Macros working behind it.
Introduction
Document Purpose
This document covers all the necessary details pertaining to the project and also describes the functionality in an orderly fashion.
Product Scope
This project works on VBA Technology . The main purpose of developing this software is to provide sorted, There are n number of application in our college .The application will
develop interface that update local cached database and will make final updation at the end of day in central database.
By far the most common reason to use VBA in Excel is to automate repetitive tasks. For example, suppose that you have a few dozen workbooks, each of which has a few dozen worksheets, and each of those needs to have some changes made to it. The changes could be as simple as applying new formatting to some fixed range of cells or as complex as looking at some statistical characteristics of the data on each sheet, choosing the best type of chart to display data with those characteristics, and then creating and formatting the chart accordingly. Either way, you would probably rather not have to perform those tasks manually, at least not more than a few times. Instead, you could automate the tasks by using VBA to write explicit instructions for Excel to follow. VBA is not just for repetitive tasks though. You can also use VBA to build new capabilities into Excel (for example, you could develop new algorithms to analyze your data, then use the charting capabilities in Excel to display the results), and to perform tasks that integrate Excel with other Office applications such as Microsoft Access 2010. In fact, of all the Office applications, Excel is the one most used as something that resembles a general development platform. In addition to all the obvious tasks that involve lists and accounting, developers use Excel in a range of tasks from data visualization to software prototyping. Despite all of the good reasons to use VBA in Excel 2010, it is important to remember that the best solution to a problem might not involve VBA at all. Excel has a large range of features even without VBA, so even a power user is unlikely to be familiar with them all. Before you settle on a VBA solution, search the Help and online resources thoroughly to make sure that there is not a simpler way.
Objects
Programming objects relate to each other systematically in a hierarchy called the object model of the application. The object model roughly mirrors what you see in the user interface; for example, the Excel object model contains the Application, Workbook, Sheet, and Chart objects, among many others. The object model is a conceptual map of the application and its capabilities.
Collections
Many objects come in both singular and plural versionsWorkbook and Workbooks, Worksheet and Worksheets, and so on. The plural versions are called collections. Collection objects are used to perform an action on multiple items in the collection. Later on, this article discusses how to use the Worksheets collection to change the name of each worksheet in a workbook.
Developer Tab
All Office 2010 applications use the ribbon. One tab on the ribbon is the Developer tab, where you access the Visual Basic Editor and other developer tools. Because Office 2010 does not display the Developer tab by default, you must enable it using the following procedure:
Security Issues
Click the Macro Security button to specify which macros can run and under what conditions. Although rogue macro code can seriously damage your computer, security conditions that prevent you from running helpful macros can seriously undermine your productivity. Macro security is a complex and involved topic that you should study and understand if you work with Excel macros. For the purposes of this article, be aware that if the Security Warning: Macros have been disabled bar appears between the ribbon and the worksheet when you open a workbook that contains a macro, you can click the Enable Content button to enable the macros. Also, as a security measure, you cannot save a macro in the default Excel file format (.xlsx); instead, you must save the macro in a file with a special extension, .xlsm.
Sub Hello() End Sub Sub stands for Subroutine, which you can define for now as "macro". Running the Hello macro runs any code that is between Sub Hello() and End Sub. Now edit the macro so that it looks similar to the following code.
VB
Sub Hello()
MsgBox ("Hello, world!") End Sub Go back to the Developer tab in Excel and click the Macros button again. Select the Hello macro in the list that appears and then click Run to display a small message box that contains the text, "Hello, world!" You just created and implemented custom VBA code in Excel. Click OK in the message box to close it and finish running the macro. If the message box does not appear, check your macro security settings and restart Excel.
A Real-World Example
Suppose that you have a workbook that contains lists on a large number of worksheets and that you want to change the name of each worksheet to match the heading of the list on that worksheet. Not every worksheet has a list on it, but if it does, the heading is in cell B1, and if it does not, cell B1 is blank. The names of worksheets without lists should be left alone. Ordinarily, this could be a complex task that involves looking at each worksheet to see if it has a list, copying the name if it does, clicking the worksheet tab, and then pasting in the new name. Instead of performing all of those steps manually, use Excel VBA to rename the sheets automatically.
The first step is to find out how to manipulate the particular objects that you need to work with to accomplish your task; for example, worksheets, worksheet names, cells, and cell contents. In Excel, there are at least two ways to approach the problem: Go directly to the Object Model Reference. Record some of the actions that you want to automate, see how the recorded code manipulates the objects, and then go to the Object Model Reference for more information. Opinions vary on which approach is preferable, but for now, try using the Macro Recorder first.
3. Go to the Developer or View tab, click the Macros button, and choose Edit to open the Visual Basic Editor. The code in the Visual Basic Editor should look similar to the following.
VB
Sub RenameWorksheets() ' ' RenameWorksheets Macro ' ' Sheets("Sheet1").Select Sheets("Sheet1").Name = "New Name" End Sub The first four lines after the Sub line are comments. Any line that begins with an apostrophe is a comment and has no effect on what the macro does. The main uses for comments are the following: To make the code easier to understand, not just for you, but for anyone else who might need to modify the code later. To temporarily disable a line of code (called commenting it out). The four comments in this recorded macro serve neither purpose, so delete them. The next line uses the Select method to select the Sheet1 member of the Sheets collection object. In VBA code, it is not generally necessary to select objects before manipulating them, even though that is what the Macro Recorder does. In other words, this line of code is redundant, so you can delete it as well. The last line of the recorded macro modifies the Name Property of the Sheet1 member of the Sheetscollection. This is the line to keep. After you make your changes, the recorded code should now look like the following.
VB
Sub RenameWorksheets() Sheets("Sheet1").Name = "New Name" End Sub Manually change the sheet called New Name back to Sheet1, then run the macro. The name should change back to New Name.
Looping
One limitation of the code up to this point is that it only makes a change to one worksheet. You could add another line for each worksheet that you want to rename, but what if you do
not know how many worksheets there are, or what their current names are? You need a way to apply some rule for each sheet in the workbook. VBA has a construction called a For Each loop that is ideal. The For Each loop examines each item in a collection object such as Worksheets and can be used to take an action (like change a name) to some or all of those items. For more information about the For Each loop, see the VBA Language Reference. Click "Visual Basic Conceptual Topics", then "Using For Each...Next Statements". Also, be aware that the VBA Language Reference, like the Object Model Reference, will amply repay the time that you spend browsing it, and is an excellent place to look for ideas if you get stuck working on code. Using the third example in the "Using For Each...Next Statements" topic, edit the macro so that it looks similar to the following code.
VB
Sub RenameWorksheets() For Each myWorksheet In Worksheets myWorksheet.Name = "New Name" Next End Sub myWorksheet is a variable; that is, what it represents varies. In this case, the myWorksheet variable successively represents each worksheet in the Worksheets collection. You do not have to use myWorksheet; you could use "x", "ws", "WorksheetToRenameAfterTheContentsOfCellB1", or (with a few restrictions) almost any name that you want. A good rule of thumb is to use variable names that are long enough to remind you of what the variable stands for, but not so long as to clutter the code. If you run the macro in its current state, it produces an error because Excel requires each worksheet in a workbook to have a unique name, but the following line instructs Excel to give every worksheet the same name.
VB
myWorksheet.Name = "New Name" To correct the line so that you can verify that the For Each loop works, change the line to the following.
VB
myWorksheet.Name = myWorksheet.Name & "-changed" Instead of trying to give each worksheet the same name, this line changes the current name of each worksheet (myWorksheet.Name) to the current name with "-changed" appended to it.
Useful Renaming
The macro is getting close to something that might actually solve the problem at hand. What you need now is a way to take information from the worksheets themselvesspecifically from cell B1 on each worksheetand put that information into the names of the worksheets. This time, instead of using the Macro Recorder to find out how to refer to a cell, take a guess and see if using the Cell object will work. It is a good guess, but if you open the Object Model Reference and search for the Cell object, you find that there is no Cell object! There is a CellFormat object though. The CellFormat object topic includes the following code in the first code sample.
VB
It turns out that you use Range to specify a range of cells or just one individual cell. Again, you do not need the .Select portion, but you do need to find out how to refer to the contents of the Range object, as opposed to the Range object itself. If you go to the Range object topic, you can read that Range has both Methodsand Properties. The contents of a Range is a thing, not an action, so it would probably be a Property. If you scan down through the list, you can see the Value property. So, try the following.
VB
Sub RenameWorksheets() For Each myWorksheet In Worksheets myWorksheet.Name = myWorksheet.Range("B1").Value Next End Sub You get an error if you run this on a workbook that contains worksheets where B1 is empty, because an emptyRange has a Value of "" (an empty text string), which is not a legal worksheet name. It is about time to create some sample data anyway. Make the three sheets in the workbook look similar to the figure below, and then run the macro.
VB
If myWorksheet.Range("B1").Value <> "" Then And after the myWorksheet.Name line add the following text.
VB
End If This is called an IfThen statement. The IfThen statement instructs Excel to do whatever is on the lines between the If line and the End If line, but only if the condition in the If line is met. In the example, the following line specifies the condition to meet.
VB
myWorksheet.Range("B1").Value <> "" The <> means "is not equal to", and the quotation marks with nothing between them represent an empty text string; that is, no text at all. Therefore, whatever lines of code come between the If and the End If will only be executed if the value in B1 is not equal to nothing; that is, if there is text in cell B1. For more information about the IfThen statement, see the VBA Language Reference. (The full name is "IfThenElse statement", where Else is an optional component.)
Variable Declarations
Another improvement that you should make to the macro is to put a declaration of the myWorksheet variable at the start of the macro.
VB
Dim myWorksheet As Worksheet Dim is short for "Dimension", and Worksheet is the type of this particular variable. This statement tells VBA what kind of entity myWorksheet represents. Note that after you type As, the Visual Basic Editor displays a popup that lists all the available variable types. That is an example of IntelliSense technology; that is, the Visual Basic Editor responds to what it determines you are trying to do and offers a list of appropriate options. You can choose an option from the list or just continue typing. Although variable declarations are not required in VBA, using them is strongly recommended! Variable declarations make it much easier to keep track of your variables and to track down bugs in the code. Also, be aware that if you declare a variable with an object type (like Worksheet), IntelliSense displays an appropriate list of properties and methods associated with that object if you use the object variable later in the macro.
Comments
The macro is complex enough now to include some comments that remind you what the code is doing. The number of comments to use is partly a matter of personal style, but in general, too many comments are better than too few. Code usually needs to be modified and updated over time. Without comments, it can be hard to understand what is going on in the code, especially if the person who modifies the code is not the same person who wrote it in the first place. Adding comments for the If condition and for the line that renames the worksheets, results in the following code.
VB
Sub RenameWorksheets() Dim myWorksheet As Worksheet For Each myWorksheet In Worksheets 'make sure that cell B1 is not empty
If myWorksheet.Range("B1").Value <> "" Then 'rename the worksheet to the contents of cell B1 myWorksheet.Name = myWorksheet.Range("B1").Value End If Next End Sub To test the macro, rename the worksheets back to Sheet1, Sheet2, and Sheet3 and delete the contents of cell B1 on one or more of the worksheets. Run the macro to verify that it renames the worksheets that have text in cell B1 and leaves the other worksheets alone. The macro works for any number of worksheets, with any combination of populated and empty B1 cells.
Charts
One common task in Excel is to create a chart based on a range of cells. Create a new macro calledAssortedTasks and then type the following text in the Visual Basic Editor.
VB
Dim myChart As ChartObject Add a line to create the chart object and assign the myChart variable to it.
VB
Set myChart = ActiveSheet.ChartObjects.Add(100, 50, 200, 200) The numbers in the parentheses determine the position and size of the chart. The first two numbers are the coordinates of the top left corner, and the second two numbers are the width and height. Create a new blank worksheet and run the macro. The chart it creates is useless because the chart has no data. Delete the chart that you just created, and add the following lines to the end of the macro.
VB
This is a common pattern in VBA programming. First, you create an object and assign it to a variable, then you use the WithEnd With construction to do things with the object. The example code instructs the chart to use the current selection for its data. (Selection is a value for the Source parameter of the SetSourceDatamethod, not a value of an object property, so VBA syntax requires that you use a colon and an equal sign (:=) instead of just an equal sign (=) to assign the value.) Type some numbers in cells A1:A5, select the cells, and then run the macro. The chart shows up as the default type, a bar chart.
If you do not like the bar chart, you can change it to some other kind of chart by using code that is similar to the following.
VB
With myChart .Chart.SetSourceData Source:=Selection .Chart.ChartType = xlPie End With xlPie is an example of a built-in constant, also known as an enumerated constant. There are many of these throughout Excel, and they are exhaustively documented. For more information about built-in constants, see the Enumerations section of the Object Model Reference. For example, the constants for chart types are listed under "XlChartType Enumeration". You can modify the data. For example, try adding this line right after the variable declaration.
VB
Application.ActiveSheet.Range("a4").Value = 8
You can get input from the user, and use that input to modify the data.
VB
myInput = InputBox("Please type a number:") Application.ActiveSheet.Range("a5").Value = myInput Finally, add the following lines to the end of the macro.
VB
ActiveWorkbook.Save ActiveWorkbook.Close The complete macro should now look something like the following.
VB
Sub AssortedTasks() Dim myChart As ChartObject Application.ActiveSheet.Range("a4").Value = 8 myInput = InputBox("Please type a number:") Application.ActiveSheet.Range("a5").Value = myInput Set myChart = ActiveSheet.ChartObjects.Add(100, 50, 200, 200) With myChart .Chart.SetSourceData Source:=Selection .Chart.ChartType = xlPie End With ActiveWorkbook.Save ActiveWorkbook.Close End Sub Verify that cells A1:A5 are still selected, run the macro, type a number in the input box, and then click OK. The code saves and closes the workbook. Reopen the workbook and note the change to the pie chart.
UserForms
The previous section showed how to use a simple input box to get input from the user. In addition to the corresponding message box that displays information, VBA provides extensive capabilities that you can use to create custom dialog boxes, to code controls that are placed directly on worksheets, or to manipulate the dialog boxes that are built in to Excel. For more information about these capabilities, see Controls, Dialog Boxes, and Forms in the Excel 2007 Developer Reference. This section completes this introductory look at Excel VBA by taking a quick look at UserForms. On the Developer tab, click the Visual Basic button to open the Visual Basic Editor, and then go to the Insertmenu and choose UserForm to open the UserForm Design View. You will see two windows. One represents the UserForm that you are creating and the other, the Toolbox, shows the various controls that you can add to your UserForm; for example, command buttons, option buttons, check boxes, and so on. You can move the mouse over a Toolbox control to see what type of control it creates. Create a very simple UserForm with a single button that runs the Hello macro from earlier in this article. In theToolbox, depress the the CommandButton control, and then drag it to the UserForm to create a command button. Right-click the command button and choose View Code.
The Sub that you see is a skeleton for an event procedure, which runs when a particular event occurs. In this case, as the name of the Sub indicates, the event that runs the code is a Click on CommandButton1. Add the following line to the event procedure.
VB
Run("Hello") The Visual Basic Editor should now look similar to the following.
Save the workbook, go to the Window menu, and choose UserForm1 (UserForm) to redisplay the UserForm. Click the green arrow on the toolbar to run the UserForm. When the dialog box appears, click the command button to run the Hello macro, which displays the "Hello, world!" message box. Close the message box to return to the running UserForm, then close the running UserForm to return to Design View.
To speed up routine editing and formatting To combine multiple commands; for example, inserting a table with a specific size and borders To automate a complex series of tasks."
Running Macros
Whenever you open any file that contains macros, Excel and Excel will warn you that the macros embedded may be malicious and harmful. If you downloaded your file from a dubious source (like freefreefreetermpapers.com), be sure to click Disable Macros. You'll still be able to view the document's contents, but all of the special bells and whistles associated with the file's macros will be disabled. You'll lose functionality, but there will be no security risk. If you know the file came from a legitimate source, and you can verify that the person who sent you the file himself doesn't have a virus that snuck into the file, you can go ahead and click Enable Macros. In order to permanently change your security levels, on a Windows machine go to Tools > Macro > Security and change it between High, Medium, and Low. Excel 2004 for Macs don't have these security levels; instead, you can change whether Excel warns you about macros or not by going to Excel > Preferences and then by switching to Security and unchecking the box for Warn before opening a file that contains macros. After the file has opened, you can navigate to Tools > Macro > Macros to see what Macros are contained inside the document. The example files will have pre-written macros. Select any one of them and click Run to see what it does. A Excel of caution: after you've run a macro in Excel, you cannot undo it; in Excel, you can only undo each step of the macro. Therefore, be very sure that the macro you're running has the intended effect you want; otherwise, save your document before running an untested macro so you can always revert back.
doesn't guarantee that you'll be in the right place. If it works, that's great, but be forewarned that if things start acting strange, there's a logical reason as to why it's doing that. This note is good to remember when coding more complex actions. If things don't work the way you planned, always assume first that you are entering your series of keys incorrectly.) So now we know how to perform our macro and we've rehearsed it. Now it's time to turn on the "video camera" so to say and capture it. 1. Go to Tools > Macro > Record New Macro 2. Type in a descriptive macro name. 3. With the Store Macro In drop down menu, you can choose whether you want the macro to always be saved inside the file or within all documents. For now, just choose All Documents. (The difference is explained more in detail in the Installing External Macros section). 4. You now have the option of adding either a toolbar or keyboard shortcut to be associated with your macro. You can also skip this step and get right to recording by hitting OK. 5. Enter in your series of key combinations. In case you forgot, the key combinations should be: a. Ctrl + Down Arrow / Apple + Down Arrow b. Backspace c. Space 6. Hit the stop button once you've completed the task. You can now run your macro to test that it works. Assign a shortcut key to the macro (see section below) and then continue hitting the shortcut key or toolbar button to watch your macro quickly clean up all the annoying line breaks.
Answer: 1. Start recording. 2. Go to the Standard Toolbar and locate the Tables button and then click and drag out a 3 by 3 table. Or, go to Table > Insert > Table, fill out 3 for Rows and 3 for Columns and hit Ok. 3. Your cursor will automatically place itself in the first cell. Type in A Table Made with Macros! 4. Now go to Table > Table Properties 5. In the Table tab, click on the Borders and Shading button near the bottom. 6. Click on the Box style on the left and change the Width of the line to 3 pt.
7. Stop recording. 2. For this example, you have a chunk of text where you want to italicize everything that is between double quotes. Sometimes this is a single Excel and sometimes it's more than one. You then want to remove the double quotes after you're done. How do you do this? Answer: 1. Start recording 2. Edit > Find or Ctrl + F 3. Search for a double quote ( " ) 4. Close the search box and hit the right arrow key 5. Hit Enter to move the start of the quotes text onto the next line 6. Edit > Find or Ctrl + F again 7. Search for a double quote ( " ) again 8. Close the search box and hit the left arrow key 9. Hit enter to move the double quote onto the next line 10. Hit Ctrl + up arrow key. 11. The piece of text that was between the double quotes should be on one line now. Select it all by hitting Ctrl + Shift + Down 12. Ctrl + I or click Italicize on the Format toolbar 13. Now hit Ctrl + Up 14. Hit Backspace twice (or the Delete key above the Enter key if you use a Mac) 15. Hit Ctrl + Down 16. Hit Backspace once and Delete once 17. Stop Recording
To associate a toolbar button with a macro you already have created on a Windows version: 1. Go to Tools > Customize On a Mac Version 1. Go to Tools > Customize > Customize Toolbars / Menus Then: 1. Click the Commands tab. 2. Scroll down on the left pane down to Macros. It should be near the bottom of the list. 3. After selecting Macros, you'll notice the right pane update to show all the macros in your global template. If the macro you wish to customize is not listed, it might be embedded in your document. If that's the case, change the Save In drop down menu to your document. 4. Just click, drag, and drop the macro to one of your toolbars and it will appear. 5. On a Windows version, to either rename it so it takes up less space on your toolbar or to change it to a graphic button, go back to Tools > Customize. Mac users can right click on the button at any time and choose Properties to change the name or the graphic. a. Windows users must right-click the button they want to change while inside the Customize menu. b. You can then select the Name field and edit it or change the button image. If you mess up, you can right-click the button and select Delete. Once you've edited its style to you satisfaction, you can now simply click the button to run the macro.
The next time you open Excel, the macro you imported will be available for use in every new document.
need to bold the text in cell A5 in all your documents, you can write a macro for that. However, if you want to write a macro that is more flexible and doesn't rely on all your documents looking the same, Excel allows you to toggle the Relative References button when you record. The Relative References option allows you to change data based upon what cell is initially selected. When you go to record, Excel will figure out what cells you're changing based upon how far they are away from the initial cell you had selected. This is great for performing the same action many times around similarly structured data within your spreadsheet. Once you're ready to record: 1. Go to Tools > Macros > Macro 2. Enter in a name, and if you want, a keyboard shortcut 3. Select where you want to save your macro from the Store In drop down menu. For almost all cases, you'll want to store it in This Workbook. 4. Like with Excel, a small two button window will appear. However, the second button is no longer a pause button, but the relative reference button we discussed. If your macro requires it, click it to change its highlighting to red indicating that it is toggled on. 5. Perform your actions. 6. Click the stop button.
Answer: 1. Start recording your macro 2. Since you'll be changing the same cell on all of your documents, you won't need to use relative references. Make sure that the relative references button is not highlighted in red. 3. Click on the A1 cell and start applying your special style. You can find all of these formatting options on your Formatting toolbar. 4. The only option that isn't available there is the ability to center across your page. To do this you need to merge together some cells in you're A row. Select across about 5 or 6 columns, from A1 to F1 or H1, right click the cells, and select Format Cells. 5. Switch to the Alignment tab and check the box for Merge Cells and hit OK. 2. There are times when you have already set up columns of data. Suppose you want to add them up using the Autosum feature and then Autofill in order to add up multiple columns quickly. However, suppose you had several of these columns all over your spreadsheet. How would you do this? Answer: 1. Since we'll be applying this macro to several places throughout your spreadsheet, a macro that does not utilize Relative References will not be very functional. Thus,
2. 3. 4. 5. 6.
before you begin recording, be aware of what cell is currently selected since it will be used by Excel to figure out how to affect the other cells. In this case, you want to select the cell directly beneath the columns to be added. Start recording your macro Toggle the Relative References button. Click on the Autosum button. Your column of data to be added will be actively highlighted. If it isn't highlighted correctly, manually change it. Hit Enter. Autofill across so that Autosum formula is replicated across the appropriate columns. Stop recording.
Now, if we want to use this macro in another place in our spreadsheet, we just need to position our active cell in the position right under a column of data and then run the macro.
To add a graphical button for a macro: 1. Tools > Customize on Windows or Tools > Customize > Customize Toolbars/Menus on a Mac 2. Click on the Commands tab 3. Click Macros in the left pane 4. Click and drag New Macro Item to your toolbar 5. Click on the new button you've created 6. A new dialog box appears; click on the macro you want to assign to that button a. To rename the button on a Windows version you must first open Tools > Customize and while inside the Customize menu, right-click the button you wish to change and click on the name field. Rename it appropriately. b. To rename the button or change its graphical icon on a Mac version, simply right-click the button at any time and select Properties. You can then change the appropriate options from the new window.
Unlike Excel, you cannot move a macro in one of your workbooks to Excel's master template so that it always is available when you open a new workbook. Instead, you must transfer macros between workbooks, and store them in each other individually. To do this: 1. 2. 3. 4. Tools > Macro > Visual Basic Editor On the top left pane, locate the file which holds the macro you want to transfer. Click the + sign to open up the folders underneath Locate the Modules Folder. Inside will be several files named "Module X" where X is a number. Double click one of them to see if it is the right macro you want copied 5. Click and drag it to the document you want it available in. 6. Save the new file.
This tutorial covers the steps to creating and using formulas in a Google Docs Spreadsheet. It is intended for those with little or no experience in working with spreadsheet programs. A Google Docs Spreadsheet formula allows you to perform calculations on data entered into the spreadsheet. You can use a formula for basic number crunching, such as addition or subtraction, as well as more complex calculations such as payroll deductions or averaging a student's test results. In addition, if you change the data the spreadsheet will automatically recalculate the answer without you having to re-enter the formula. Following the step by step instructions on the following pages covers how to create and use a basic formula in a Google Doc Spreadsheet.
Google Spreadsheet Formula Tutorial: Step 1 of 3 The following example creates a basic formula. The steps used to create this basic formula are the same ones to follow when writing more complex formulas. The formula will first add the numbers 5 + 3 and then subtract 4. The final formula will look like this: = A1 + A2 - A3 Step 1: Entering the data Note: For help with this tutorial refer to the image above. Type the following data into the appropriate cell. A1 : 3 A2 : 2 A3 : 4
8. Click on cell A4. The complete formula = A1 + A2 - A3 is shown in the formula bar above the worksheet.
System requirements Google Cloud Connect works for Microsoft Word, PowerPoint, and Excel files for users of Microsoft Office 2003, 2007, and 2010. It supports Windows XP, Windows Vista, and Windows 7. It is currently not available for Macs. For more details, see System requirements. How does it work? Syncing and sharing documents: Google Cloud Connect tracks, manages, and syncs all changes on your Microsoft Office documents into one updated version for each document. Each document that you sync through Google Cloud Connect gets a unique URL, or web address, that you can share with collaborators through IM or email. Depending on the privacy setting youve selected for the document, other people will be able to click this link and view the document in the browser. Collaborating simultaneously on documents: Google Cloud Connect for Microsoft Office lets you easily share documents with other people. When you add someone as an editor in a document, they receive an e-mail letting them know that a document has been shared with them. From there, they can open a link to view the document in the browser, or if they want to make edits, they can download the document and open it in Microsoft Office. When another editor edits a document in Microsoft Office, all changes get synced to and will be reflected on your screen. Revision history: Using Google Cloud Connect, you can edit a document both online and offline. Every time you sync a document, the revisions of a document are stored so you can easily roll back to a previous version. You can retrieve and revert to any prior revision of a document at any time.
Collaborating on a document has become increasingly easy these past few years. You can work together on the same document using services like EtherPad, you can have your documents in the cloud using Google Docs or you can sync your documents in real-time using services like Dropbox and this is just naming a few. Another player in the field is Google Cloud Connect. Google Cloud Connect is a plugin for MS Office that connects your Office documents to your Google Docs. It serves both as a backup for your documents, and as a means to share, get feedback and collaborate on a document.
You will then get the chance to configure the global settings of the plugin. There isnt much to configure here, really you can choose to sync your documents manually or automatically, and you can decide where the files will be saved. This is also the place to go if you wish to associate Cloud Connect with a different Google account.
The Cloud Connect toolbar is quite obtrusive. If you want to hide it, look for the (very) small triangle in the bottom center part of the toolbar and click it. This will hide the toolbar, and you can click it again to unhide it at any time.
Syncing and Sharing Using Cloud Connect, you can create a new Word, Excel or PowerPoint document and sync it to the Google cloud or share it from within the document itself. Clicking the Sync button will sync your document to your Google Docs, and you will immediately get a link to it right in the Office window. The Share button will allow you to add people to this document. You can add many people at once, and choose whether theyll be able to edit the document or just view it.
When you sync your document to the cloud, it will appear in your Google Docs. You will now be able to access it and view it online, but you will not be able to edit the document using Google Docs. The document will be mingled with your other Google Docs, and you can tell them apart by the little icons on the left.
If viewing and sharing online is not enough, you can convert your Office Doc into a Google Doc easily, by clicking on Actions and creating a Google Docs copy. However, you will not be able to download this copy using Cloud Connect and work on it offline.
Downloading The newest feature of Cloud Connect is the ability to download documents from Google Docs into MS Office, right from the MS Office window. To do this, click on the huge Google Cloud Connect logo and choose Open from Google Docs.
Note again, that you cannot download your Google Docs into MS Office. To use this feature, you will need to have Office documents synced to your Google Docs first. When you have some of those, you will be able to choose the document you want to download, and get it to instantly open in Office.
Collaborating Cloud Connect can be used to work together on a document. If what you all like best is to work on your document in Office on your own computer, this could be the solution for you. Each person can download and edit the document, and then sync it to the cloud. If youre all working on it at the same time, you might get messages like this:
This is nice, because it makes it harder for several people working together on the same document to erase each others work, and it also keeps all the versions of the document, in
case you wish to revert. To access all the versions from within Office, click on the little page icon and choose See revision history.
Module
Private Sub cmdadd_Click() Set ws = Worksheets("Sheet1") lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
For Each cell In Range("a1:a" & Range("a65536").End(xlUp).Row) If Val(UserForm1.TextBox1.Value) = cell.Value Then UserForm1.TextBox1.SetFocus MsgBox "already stored information" Exit Sub End If Next
Private Sub cmddel_Click() Set ws = Worksheets("Sheet1") If ComboBox1.ListIndex = -1 Then MsgBox "no information to delete" End If
If ComboBox1.Value = "" Then MsgBox " pls chose a roll no first" Else: For Each cell In Range("a1:a" & Range("a65536").End(xlUp).Row) If ComboBox1.Value = cell.Value Then lrow = cell.Row End If Next ws.Rows(lrow).EntireRow.Delete ComboBox1.RemoveItem (ComboBox1.ListIndex) End If ComboBox1.ListIndex = 0 End Sub
Private Sub cmdfirst_Click() Set ws = Worksheets("Sheet1") lrow = 2 Me.TextBox1.Value = ws.Cells(lrow, 1) Me.TextBox2.Value = ws.Cells(lrow, 2) Me.cbobranch.Value = ws.Cells(lrow, 3) Me.ComboBox2.Value = ws.Cells(lrow, 4) Me.ComboBox3.Value = ws.Cells(lrow, 5) Me.ComboBox4.Value = ws.Cells(lrow, 6) Me.TextBox7.Value = ws.Cells(lrow, 7)
End Sub
Private Sub cmdlast_Click() Set ws = Worksheets("Sheet1") lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row
Me.TextBox1.Value = ws.Cells(lrow, 1) Me.TextBox2.Value = ws.Cells(lrow, 2) Me.cbobranch.Value = ws.Cells(lrow, 3) Me.ComboBox2.Value = ws.Cells(lrow, 4) Me.ComboBox3.Value = ws.Cells(lrow, 5) Me.ComboBox4.Value = ws.Cells(lrow, 6) Me.TextBox7.Value = ws.Cells(lrow, 7) End Sub
Private Sub cmdnext_Click() Set ws = Worksheets("Sheet1") lrow = 2 For Each cell In Range("a1:a" & Range("a65536").End(xlUp).Row) If cell.Value = Val(Me.TextBox1.Value) Then lrow = cell.Row + 1 If lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1 Then
MsgBox "this is the last record" lrow = 2 End If End If Next Me.TextBox1.Value = ws.Cells(lrow, 1) Me.TextBox2.Value = ws.Cells(lrow, 2) Me.cbobranch.Value = ws.Cells(lrow, 3) Me.ComboBox2.Value = ws.Cells(lrow, 4) Me.ComboBox3.Value = ws.Cells(lrow, 5) Me.ComboBox4.Value = ws.Cells(lrow, 6) Me.TextBox7.Value = ws.Cells(lrow, 7)
End Sub
Private Sub cmdprev_Click() Set ws = Worksheets("Sheet1") lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row For Each cell In Range("a1:a" & Range("a65536").End(xlUp).Row) If cell.Value = Val(Me.TextBox1.Value) Then lrow = cell.Row - 1 If lrow = 1 Then
MsgBox "this is the first record" lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row End If End If Next Me.TextBox1.Value = ws.Cells(lrow, 1) Me.TextBox2.Value = ws.Cells(lrow, 2) Me.cbobranch.Value = ws.Cells(lrow, 3) Me.ComboBox2.Value = ws.Cells(lrow, 4) Me.ComboBox3.Value = ws.Cells(lrow, 5) Me.ComboBox4.Value = ws.Cells(lrow, 6) Me.TextBox7.Value = ws.Cells(lrow, 7) End Sub
Private Sub cmdupdate_Click() Set ws = Worksheets("Sheet1") If ComboBox1.Value = "" Then MsgBox " pls chose a roll no first" Else:
For Each cell In Range("a1:a" & Range("a65536").End(xlUp).Row) If Val(Me.ComboBox1.Value) = cell.Value Then lrow = cell.Row
End If Next
store (lrow)
Dim ws As Worksheet Set ws = Worksheets("Sheet1") x=0 For Each cell In Range("a2:a" & Range("a65536").End(xlUp).Row) If cell.Value = Val(ComboBox1.Value) Then lrow = cell.Row x=1 End If Next If x = 0 Then MsgBox "no data exists with this id" lrow = 2 End If
Me.TextBox1.Value = ws.Cells(lrow, 1) Me.TextBox2.Value = ws.Cells(lrow, 2) Me.cbobranch.Value = ws.Cells(lrow, 3) Me.ComboBox2.Value = ws.Cells(lrow, 4) Me.ComboBox3.Value = ws.Cells(lrow, 5) Me.ComboBox4.Value = ws.Cells(lrow, 6) Me.TextBox7.Value = ws.Cells(lrow, 7) End Sub
End Sub
For Each cControl In Me.Controls If cControl.Name Like "Text*" Then TextBox8.BackColor = vbRed End If Next End Sub
cbobranch.AddItem "cse" cbobranch.AddItem "it" cbobranch.AddItem "ec" cbobranch.AddItem "en" cbobranch.AddItem "me"
With ComboBox2 .AddItem "a" .AddItem "b" .AddItem "c" .AddItem "d" .AddItem "e" .AddItem "f" .AddItem "g" .AddItem "h"
End With
With ComboBox3 .AddItem "1" .AddItem "2" .AddItem "3" .AddItem "4"
End With
With ComboBox4 .AddItem "1" .AddItem "2" .AddItem "3" .AddItem "4" .AddItem "5" .AddItem "6" .AddItem "7" .AddItem "8" End With
End Sub
Main Project
Forms
Authentic form
Fullform
End Sub
Dim ws As Worksheet
Set ws = Worksheets("master") Dim pict As Object x=0 For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If cell.Value = Val(ComboBox1.Value) Then lrow = cell.Row x=1 End If Next If x = 0 Then MsgBox "no data exists with this id" Else
End If
End Sub
End Sub
Call GetActiveWorkbookPath Dim imageload_initial As String imageload_initial = GetFilePath & "images\" & "imagenotavailable.jpg" Me.Image1.Picture = LoadPicture(imageload_initial) Me.Image1.PictureSizeMode = fmPictureSizeModeStretch
Dim ctrl As Control For Each ctrl In Me.Controls If TypeName(ctrl) = "TextBox" Then ctrl.Enabled = False End If Next
End Sub Name of student Dim i As Integer Dim j As Integer Dim l As Integer Dim lrow As Integer Public GetFilePath As String
FullPathFileName = ActiveWorkbook.FullName GetFilePath = Mid(FullPathFileName, 1, InStrRev(FullPathFileName, "\")) ' MsgBox "Active Workbook Full Path = " & GetFilePath
End Sub
End Sub
Sub image_load_combo() Call GetActiveWorkbookPath Dim loadimg As String loadimg = GetFilePath & "\images\" & ComboBox1.Value & ".jpg" 'MsgBox (loadimg) 'Worksheets(i).Name = temp & "-" & temp + 4
End Sub Private Sub clear() Dim z As Control For Each z In UserForm1.Controls If TypeName(z) = "TextBox" Then z.Value = "" End If Next z End Sub
End Sub
For Each cell In Range("e1:e" & Range("e65536").End(xlUp).Row) If Val(UserForm1.TextBox1.Value) = cell.Value Then UserForm1.TextBox1.SetFocus MsgBox "already stored information" Exit Sub End If Next
End Sub
Set ws = Worksheets("master") If ComboBox1.ListIndex = -1 Then MsgBox "no information to delete" End If If ComboBox1.Value = "" Then MsgBox " pls chose a roll no first" Else: For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If Val(TextBox1.Value) = cell.Value Then lrow = cell.Row End If Next ws.Rows(lrow).EntireRow.Delete ComboBox1.RemoveItem (ComboBox1.ListIndex) End If ComboBox1.ListIndex = 0 Call clear End Sub
Private Sub cmdlast_Click() Set ws = Worksheets("master") lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row
Private Sub cmdnext_Click() Set ws = Worksheets("master") lrow = 3 For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If cell.Value = Val(Me.TextBox1.Value) Then lrow = cell.Row + 1 If lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1 Then MsgBox "this is the last record"
lrow = 3 End If End If Next display (lrow) Call image_load_non_combo Call change_value_of_combobox_on_first_next_previous_last End Sub
Private Sub cmdprev_Click() Set ws = Worksheets("master") lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If cell.Value = Val(Me.TextBox1.Value) Then lrow = cell.Row - 1 If lrow = 2 Then MsgBox "this is the first record" lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row End If End If Next display (lrow)
Private Sub cmdup_Click() Set ws = Worksheets("master") If ComboBox1.Value = "" Then MsgBox " pls chose a roll no first" Else:
For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If Val(Me.ComboBox1.Value) = cell.Value Then lrow = cell.Row End If Next
Set ws = Worksheets("master") x=0 For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If cell.Value = Val(ComboBox1.Value) Then lrow = cell.Row x=1 Call image_load_combo End If Next If x = 0 Then MsgBox "no data exists with this id" lrow = 2 End If display (lrow)
End Sub
For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If cell.Value = Val(ComboBox1.Value) Then lrow = cell.Row x=1 End If Next If x = 0 Then MsgBox "no data exists with this id" Else
End If
End Sub
End Sub
End Sub
Private Sub UserForm_Initialize() Call GetActiveWorkbookPath Dim imageload_initial As String imageload_initial = GetFilePath & "images\" & "imagenotavailable.jpg" Me.Image1.Picture = LoadPicture(imageload_initial) Me.Image1.PictureSizeMode = fmPictureSizeModeStretch
Dim ctrl As Control For Each ctrl In Me.Controls If TypeName(ctrl) = "TextBox" Then ctrl.Enabled = False End If Next
End Sub
FullPathFileName = ActiveWorkbook.FullName GetFilePath = Mid(FullPathFileName, 1, InStrRev(FullPathFileName, "\")) ' MsgBox "Active Workbook Full Path = " & GetFilePath
End Sub
End Sub
Sub image_load_combo() Call GetActiveWorkbookPath Dim loadimg As String loadimg = GetFilePath & "\images\" & ComboBox1.Value & ".jpg" 'MsgBox (loadimg) 'Worksheets(i).Name = temp & "-" & temp + 4
End Sub Private Sub clear() Dim z As Control For Each z In UserForm1.Controls If TypeName(z) = "TextBox" Then z.Value = "" End If Next z End Sub
End Sub
For Each cell In Range("e1:e" & Range("e65536").End(xlUp).Row) If Val(UserForm1.TextBox1.Value) = cell.Value Then UserForm1.TextBox1.SetFocus MsgBox "already stored information" Exit Sub End If Next
End Sub
Set ws = Worksheets("master") If ComboBox1.ListIndex = -1 Then MsgBox "no information to delete" End If If ComboBox1.Value = "" Then MsgBox " pls chose a roll no first" Else: For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If Val(TextBox1.Value) = cell.Value Then lrow = cell.Row End If Next ws.Rows(lrow).EntireRow.Delete ComboBox1.RemoveItem (ComboBox1.ListIndex) End If ComboBox1.ListIndex = 0 Call clear End Sub
Private Sub cmdlast_Click() Set ws = Worksheets("master") lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row
Private Sub cmdnext_Click() Set ws = Worksheets("master") lrow = 3 For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If cell.Value = Val(Me.TextBox1.Value) Then lrow = cell.Row + 1 If lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1 Then MsgBox "this is the last record"
lrow = 3 End If End If Next display (lrow) Call image_load_non_combo Call change_value_of_combobox_on_first_next_previous_last End Sub
Private Sub cmdprev_Click() Set ws = Worksheets("master") lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If cell.Value = Val(Me.TextBox1.Value) Then lrow = cell.Row - 1 If lrow = 2 Then MsgBox "this is the first record" lrow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row End If End If Next display (lrow)
Private Sub cmdup_Click() Set ws = Worksheets("master") If ComboBox1.Value = "" Then MsgBox " pls chose a roll no first" Else:
For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If Val(Me.ComboBox1.Value) = cell.Value Then lrow = cell.Row End If Next
Set ws = Worksheets("master") x=0 For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If cell.Value = Val(ComboBox1.Value) Then lrow = cell.Row x=1 Call image_load_combo End If Next If x = 0 Then MsgBox "no data exists with this id" lrow = 2 End If display (lrow)
End Sub
For Each cell In Range("e3:e" & Range("e65536").End(xlUp).Row) If cell.Value = Val(ComboBox1.Value) Then lrow = cell.Row x=1 End If Next If x = 0 Then MsgBox "no data exists with this id" Else
End If
End Sub
End Sub
End Sub
End Sub
Private Sub UserForm_Initialize() Call GetActiveWorkbookPath Dim imageload_initial As String imageload_initial = GetFilePath & "images\" & "imagenotavailable.jpg" Me.Image1.Picture = LoadPicture(imageload_initial) Me.Image1.PictureSizeMode = fmPictureSizeModeStretch
Dim ctrl As Control For Each ctrl In Me.Controls If TypeName(ctrl) = "TextBox" Then
End Sub
Snap Shot
User form1
User form2
Dim ws As Worksheet Set ws = Worksheets("uidpass") Dim id As String id = Me.TextBox1.Value lrow = ws.Cells.Find(What:=id, SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row If lrow = "" Then MsgBox "invalid username" Else: If ws.Cells(lrow, 2) = TextBox2.Value Then
UserForm1.cmddel.Visible = True
Unload Me Dim ctrl As Control For Each ctrl In UserForm1.Controls If TypeName(ctrl) = "TextBox" Then ctrl.Enabled = True End If Next UserForm1.cbyn.Enabled = True Exit Sub Else: MsgBox "invalid password" End If End If
End Sub
End Sub
Password
Private Sub cmdok_Click()
Dim ws As Worksheet Set ws = Worksheets("uidpass") Dim id As String id = Me.TextBox1.Value lrow = ws.Cells.Find(What:=id, SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row If lrow = "" Then MsgBox "invalid username" Else: If ws.Cells(lrow, 2) = TextBox2.Value Then
Unload Me Dim ctrl As Control For Each ctrl In UserForm1.Controls If TypeName(ctrl) = "TextBox" Then ctrl.Enabled = True End If Next UserForm1.cbyn.Enabled = True
End Sub
End Subsss
End Sub
References:
Excel VBA Macro Programming By: Richard Shepherd Excel Macros 2007 made easy By: Gail Perry
http://en.wikipedia.org/wiki/Visual_Basic_for_Applications\
http://support.google.com/drive/bin/answer.py?hl=en&answer=1110327