4
I’m starting to use VBA with the office package, as I still know little I’m having difficulties to get this functionality.
I was trying to do something simple and I needed help to understand how it works:
I need that if one cell is changed, its contents are copied to another automatically, without having to click any button, e.g.:
I have cell A1:B5
All cells are blank, if I fill in any information in cell A1, I need the value of it to be copied to cell B1, if I change cell A2, I need the value to be changed to cell B2 and so on.
I know you can do this with formulas, but I need the VBA syntax to start doing something more advanced.
One solution is this, if you need the code quickly, surely you have a solution if you program. Developer of Excel and goes on record Macro. Then solve your problem and using formula and stop the recording. Finally edit the recorded macro and catch the code contained therein.
– Victor Henrique
Use Excel events such as
Worksheet_Change
, that is triggered when there is some change in the desired spreadsheet. Then program a conditionIf
, that if theTarget
for in the column To, the value of this will be copied to the column B.– danieltakeshi
If
B1
gets the content ofA1
why not simplify and put inB1
the formula=A1
?– Isac