Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Target Address Property for Insert/Delete Row/Column
Hi EM
I assume you are working with an event code. Declare a variable at the very top of the worksheet module to remember LastTarget. Dim LastTarget As Range Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not LastTarget Is Nothing Then MsgBox ("Current Target is " & Target.Address & vbLf & "Last Target was " & LastTarget.Address) End If Set LastTarget = Target End Sub Hopes this helps -Per "Excel Monkey" skrev i meddelelsen ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Target Address Property for Insert/Delete Row/Column | Excel Programming | |||
Insert a new column using a variable as address in a macro | Excel Programming | |||
Target.Address syntax | Excel Worksheet Functions | |||
Row/Column Insert/Delete | Excel Programming | |||
target address | Excel Programming |