VBA Replace text between brackets

  • In sheet1, the value of cell A1 is [ABCD] including the brackets. When the code executes, the value inside the bracket should change to the contacts of the selected cell in sheet2. For example, If I select Cell A2 in sheet2, the contents on A1 in sheet1 should change from [ABCD] to [contents of A2 in sheet2]. If I select Cell A5 in seet2, the contents on A1 in sheet1 should change from [ABCD] to [contents of A5 in sheet2].