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: Find a PValue with Excel

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

How To: Create a passfail grade formula in Microsoft Excel

How To: Calculate monthly retirement income in Microsoft Excel

How To: Run queries from forms in Microsoft Access

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

How To: Find critical values with T functions in MS Excel

How To: Sum dollar amounts from a column in Micrsoft Excel

How To: Use TEXT & custom number formatting in Microsoft Excel

How To: Link two (multiple) workbooks & cells in Excel

How To: Score a Full Version of Microsoft Office for Only $10

How To: Download & install the Microsoft Excel MoreFunc addin

How To: Create a line chart with time as its xaxis in Excel

How To: Calculate inventory turnover & days to sell ratios in Microsoft Excel

How To: Use VLOOKUP to verify a record is in an Excel table

How To: Track cash on hand with a table Microsoft Excel 2010

How To: Stop Excel from giving a number in scientific notation

How To: Disable quick fill handle & dragdrop Excel features

How To: Create random basic math problems in Microsoft Excel

How To: Create budgets in MS Project 2007

How To: Find a PValue with Excel

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

How To: Create a passfail grade formula in Microsoft Excel

How To: Calculate monthly retirement income in Microsoft Excel

How To: Run queries from forms in Microsoft Access

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

How To: Find critical values with T functions in MS Excel

How To: Sum dollar amounts from a column in Micrsoft Excel

How To: Use TEXT & custom number formatting in Microsoft Excel

How To: Link two (multiple) workbooks & cells in Excel

How To: Score a Full Version of Microsoft Office for Only $10

How To: Download & install the Microsoft Excel MoreFunc addin

How To: Create a line chart with time as its xaxis in Excel

How To: Calculate inventory turnover & days to sell ratios in Microsoft Excel

How To: Use VLOOKUP to verify a record is in an Excel table

How To: Track cash on hand with a table Microsoft Excel 2010

How To: Stop Excel from giving a number in scientific notation

How To: Disable quick fill handle & dragdrop Excel features

How To: Create random basic math problems in Microsoft Excel

How To: Create budgets in MS Project 2007
Be the First to Comment
Share Your Thoughts