This video shows how to enter values into cells using Excel macros and Visual Basic. This includes a sample Expense Report that is used in this demonstration. In this demonstration, we will create the macro that inputs a title as "Expense Report", Three columns i.e. "Date", "Item" & "Amount", and the summery field as "Total Expenses", as well as the formulas located at the respective cells. Now, we're going to use two keyboard shortcuts i.e. "Alt + F11" to openup the VBA window and "Alt + F8" for viewing macros. Now, first we'll start with the VBA window, go to insert menu and select module to open the module window, and add the new Values_Input() module to create the Expense Report through the macros. Now, to input the values into the cells, we use the range object i.e. Range("A1").Value, to assign the value to the cell. Then with the "Equal to" sign, we'll write with quotation "Expense Report". Then in the next line again do the same practice for "Date", "Item", "Amount" and "Total Expenses" columns, by giving the cell number and values to that cell. Then in next line, we need to give a formula for the "Total Expenses" column, i.e. "=SUM(C:C)" as we need to sum the entire "Amount" column and give value to "Total Expenses" column. Now, as our macro is ready to be used, we'll delete every thing from cell "A1" to "F3". Then, using the shortcut "Alt + F8", select the macro from the list and Run. Every thing is back as it was before. Now, in order to link/assign one cell value to another, we need to define the column range (e.g. "E4:E6") instead of a particular cell number and assign its value by formula (e.g. "=C4"). Then, run the macro again, and you'll see that the values in column "C" are assigned to its respective cell in column "E". However, if you put the dollar sign ($) in the formula reference (i.e. "=$C$4"), it will not update the cells, because it will consider it as absolute reference values. So, that's how we can enter values into the cells using macros.
 Hot
 Latest

How To: Create a Basic Attendance Sheet in Excel

How To: Find a PValue with Excel

How To: Create a passfail grade formula in Microsoft Excel

How To: Generate random numbers (with decimals) in Excel

How To: Update inventory records by formula in Microsoft Excel

How To: Create a stem & leaf chart with Excel's REPT & COUNTIF

How To: Instantly Change Blocks of 'CAPITALIZED TEXT' in Microsoft Word to 'Lowercase Letters'

How To: Create an Excel spreadsheet to calculate your GPA

How To: Extract part of a table from a larger table in Excel

How To: Enter formulas in Excel with a macro

How To: Create a relative frequency distribution in MS Excel

How To: Identify the first occurrence of a value in a column in Microsoft Excel

How To: Average with the MONTH function in Microsoft Excel

How To: Round off date and time calculations in Microsoft Excel 2010

How To: Clear data & cell contents in Excel using a macro

How To: Multiply column times row with Transpose in MS Excel

How To: Calculate income tax payroll deductions in MS Excel

How To: Repeat a list of names 7 times in Excel

How To: Use a MODE IF function in Microsoft Excel

How To: Do matrix multiplication and inverse in MS Excel

How To: Create a Basic Attendance Sheet in Excel

How To: Find a PValue with Excel

How To: Create a passfail grade formula in Microsoft Excel

How To: Generate random numbers (with decimals) in Excel

How To: Update inventory records by formula in Microsoft Excel

How To: Create a stem & leaf chart with Excel's REPT & COUNTIF

How To: Instantly Change Blocks of 'CAPITALIZED TEXT' in Microsoft Word to 'Lowercase Letters'

How To: Create an Excel spreadsheet to calculate your GPA

How To: Extract part of a table from a larger table in Excel

How To: Enter formulas in Excel with a macro

How To: Create a relative frequency distribution in MS Excel

How To: Identify the first occurrence of a value in a column in Microsoft Excel

How To: Average with the MONTH function in Microsoft Excel

How To: Round off date and time calculations in Microsoft Excel 2010

How To: Clear data & cell contents in Excel using a macro

How To: Multiply column times row with Transpose in MS Excel

How To: Calculate income tax payroll deductions in MS Excel

How To: Repeat a list of names 7 times in Excel

How To: Use a MODE IF function in Microsoft Excel

How To: Do matrix multiplication and inverse in MS Excel
Be the First to Comment
Share Your Thoughts