Is it possible to create two input cells that are equal to each other without VBA code eg. A1 = A5 and A5 = A1. So when I change the value of A1 it affects A5 and change in A5 makes A1 change too.
相关问题
- Excel sunburst chart: Some labels missing
- Error handling only works once
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
相关文章
- Get column data by Column name and sheet name
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- Unregister a XLL in Excel (VBA)
- How to prevent excel from truncating numbers in a
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- What's the easiest way to create an Excel tabl
No, it is not. It will require VBA.
A cell can have a formula or it can have a user supplied value but not both.
The only way is VBA.
You can have a third cell, say B1. Then have the user change B1 and equate A1 and A5 to B1:
Then the user only needs to change one cell and the others will update.
Strictly speaking it is possible, if the sheet is set to use iterative calculation, with using
=B1
in A5 and=A5
in B1. However entering data in either cell will overwrite the formula, so would only work the one time.Place the following event macro in the worksheet code area:
Because it is worksheet code, it is very easy to install and automatic to use:
If you have any concerns, first try it on a trial worksheet.
If you save the workbook, the macro will be saved with it. If you are using a version of Excel later then 2003, you must save the file as .xlsm rather than .xlsx
To remove the macro:
To learn more about macros in general, see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
and
http://msdn.microsoft.com/en-us/library/ee814735(v=office.14).aspx
To learn more about Event Macros (worksheet code), see:
http://www.mvps.org/dmcritchie/excel/event.htm
Macros must be enabled for this to work!