super new to vba so was hoping if i can get some help here.
I have a table of numbers with column names as shown in the screenshot below. The problem is the columns are not always in the same places. I want to create a macro that first searches for the existence of the column named "Close". Once it is found, I want to select the empty cell in row 2 to the right of the entire table (which is cell H2 in this case). Then I want to key in a simple formula which takes the adjacent cell below the header "Close" and subtract the next adjacent cell below it (which is E2 - E3 in this case). Finally I want to drag down the formula to all the empty cells below it until it reaches the last row of the table that has data in it. Another problem is after running the macro, i want the formula to appear in the function bar of excel when i click on any of the cells.
can anyone please help? been trying to do this the past 2 days!
I have a table of numbers with column names as shown in the screenshot below. The problem is the columns are not always in the same places. I want to create a macro that first searches for the existence of the column named "Close". Once it is found, I want to select the empty cell in row 2 to the right of the entire table (which is cell H2 in this case). Then I want to key in a simple formula which takes the adjacent cell below the header "Close" and subtract the next adjacent cell below it (which is E2 - E3 in this case). Finally I want to drag down the formula to all the empty cells below it until it reaches the last row of the table that has data in it. Another problem is after running the macro, i want the formula to appear in the function bar of excel when i click on any of the cells.
can anyone please help? been trying to do this the past 2 days!
