alstubna
05-23-2009, 09:41 AM
Greetings
I found some code on the net that does something I want.
It does a calculation and shows a message box with the result of that calculation. I would rather have the result entered into a cell. The cell that will get the result varies depending on what cell is the active cell when I run the code.
So far I have this -
ActiveCell.Offset(0, 1).Value = result
That works fine but sometimes I need to run the procedure several times and I need to save each result. So, what I need to do is increment the offset for each time I run the procedure. Something like this:
ActiveCell.Offset(0, find the next empty cell to the right of the active cell).Value = result
I'm sure this is simple but I'm not much of a coder.
I found some code on the net that does something I want.
It does a calculation and shows a message box with the result of that calculation. I would rather have the result entered into a cell. The cell that will get the result varies depending on what cell is the active cell when I run the code.
So far I have this -
ActiveCell.Offset(0, 1).Value = result
That works fine but sometimes I need to run the procedure several times and I need to save each result. So, what I need to do is increment the offset for each time I run the procedure. Something like this:
ActiveCell.Offset(0, find the next empty cell to the right of the active cell).Value = result
I'm sure this is simple but I'm not much of a coder.