no its not working dear
let me explain....
This is the code u provided me ..... its the 1st code
Code:
x = Right(Range("AG3").Formula, Len(Range("AG3").Formula) - 2)
Range("AG3").Value = "=U" & x + 1
End Sub
Now in cell AG3 i have the formula =u2 and when i click the command button ( macro attached to it ) once then it becomes u3 then u4 then u5 and so on....
But as soon as the formula in cell AG3 in changed from =U3 to V3 then i have to make the changes in the code also...
this part of the code
Code:
Range("AG3").Value = "=U" & x + 1
i have to change the (U) to (V)
and i have to do it everytime when the formula in AG3 changes....
See, the code is working just perfect but evertime the change has to be made in the code in order for the code to give the correct output..
What i am trying to say is ( IF POSSIBLE ) that the code should pick the column address directly from the cell so that everytime i dont have to change the column address in the code..
For Example
If in cell AG3 ----> =u2 then u3,u4,u5 and so on
If in cell AG3 ----> =v2 then v3,v4,v5 and so on
If in cell AG3 ----> =w2 then w3,w4,w5 and so on
what currently i am doing is i am changing (u) to (v) and (v) to (w) in the code also alongwith the cell...
pls let me know if there is anything yet to be cleared...
Sorry for the trouble
Awaiting reply,
Humayun