![]() |
VBA: How to specify 2nd cell of currently active row?
In a macro, I want to be able to set the value of the second cell of the
currently active row. How can I calculate the correct range or offset to do this? For example, if the currently active cell is An, I want to set A2 to a specific value. Thanks, Rich |
How to specify 2nd cell of currently active row?
Hi Rich
For a row Cells(ActiveCell.Row, 2).Value = 100 For a column Cells(2, ActiveCell.Column).Value = 100 -- Regards Ron de Bruin http://www.rondebruin.nl "Rich" wrote in message ... In a macro, I want to be able to set the value of the second cell of the currently active row. How can I calculate the correct range or offset to do this? For example, if the currently active cell is An, I want to set A2 to a specific value. Thanks, Rich |
How to specify 2nd cell of currently active row?
Thanks!
Rich "Ron de Bruin" wrote: Hi Rich For a row Cells(ActiveCell.Row, 2).Value = 100 For a column Cells(2, ActiveCell.Column).Value = 100 -- Regards Ron de Bruin http://www.rondebruin.nl "Rich" wrote in message ... In a macro, I want to be able to set the value of the second cell of the currently active row. How can I calculate the correct range or offset to do this? For example, if the currently active cell is An, I want to set A2 to a specific value. Thanks, Rich |
All times are GMT +1. The time now is 09:08 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com