Question: In Excel, is there a way to link a cell in one column to a cell in another? For example, when I enter a memo number in column A, I need a date value to appear in column B (in the corresponding row). Once the date value has been set in column A, I do not want the value to change. (ie: The date value should not change the next day when the file is opened.) Answer: This can be accomplished using a macro. Let's take a look at an example. Download Excel spreadsheet (as demonstrated below)
|
On the sheet called Sheet1, we've placed code on the "Worksheet_Change" event, so that whenever the data in column A changes, the associated cell in column B will be updated. You can press Alt-F11 to view the VBA code. Note: The dates will re-calculate if you, for example, "insert a column before column A and then delete it". So make sure that your column structures are static before you rely on the linked date values. Macro Code:The macro code looks like this:
|
Visit our busy book shop, were you can find latest books for beginners as well as advanced excel users.
Spreadsheet 123 Spreadsheet Software Development
See Spreadsheets for:
a.Hotel Management b.Personal Budget
c.Corporate Finance d.Rating Calculation e.Real Estate and Mortgage
f.Web Calc