I have an excel sheet with values in columns A, B and C like this:
A B C
1 8.22 1.99902 32.48974
2 8.22 3.04698 33.92426
3 8.22 2.26374 33.1547
4 8.22 2.78227 33.2593
6 8.22 2.46798 33.34269
6 8.22 2.57802 33.67131
7 8.22 2.46798 32.7427
8 8.22 2.57802 33.07131
There is also a cell (say for example F1) containing a value that can only be 1,2 or 3.
I would like to create a commandbutton
to perform the following job:
For each pair of lines (which cosnist a group) insert 2 new lines below them, and populate them with values like this (suppose we are dealing with the group residing in lines 9 and 10)
If F1 = 1 THEN
A11 = A10 B11 = B10 C11 = C9
A12 = A10 B12 = B9 C12 = C10
If F1 = 2 THEN
A11 = A10 B11 = B10 C11 = C9
A12 = A9 B12 = B10 C12 = C10
If F1 = 3 THEN
A11 = A10 B11 = B9 C11 = C10
A12 = A9 B12 = B10 C12 = C10
Finaly set the background color for the newely inserted lines to yellow.
Could you please help me accomplish this task?
P.S. Once a button like this was pressed, what would you recommend for an Undo
capability?