ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Target Address Property for Insert/Delete Row/Column (https://www.excelbanter.com/excel-programming/427212-re-target-address-property-insert-delete-row-column.html)

Patrick Molloy[_2_]

Target Address Property for Insert/Delete Row/Column
 
you're witnessing the ActiveCell of the selected range

the answer is not quite so straightforward. if you create a PUBLIC (ie
Global) string variable, you can save the cell/s selected address, then the
next time a new rangeb is selected , you'll have the 'target' and the 'source'

in a Standard Code Module have these two lines:

Option Explicit
Public Source As String


In the sheet's code page, code the selection change event like this:

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.StatusBar = "From " & Source & " to " & Target.Address
Source = Target.Address
End Sub


now, when you move around the worksheet, you'll see the staus bar in the
lower left show you where you moved to and where from

Hope this helps

Patrick Molloy



"Excel Monkey" wrote:

When I select call A1, the address property of the target is "$A$1". When I
select A1 and then hit Delete/Insert Rows/Column, the target is set to $1:$1.
However A1 is still selected visually (i.e. row 1 is not highlighted). I am
assuming that this is Excel's way of addressing where to insert/delete the
new range.

I need to find a way of referencing what the single cell address was prior
to excel changing it. Any ideas

Thanks

EM



All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com