Hi All,
I am using following code to copy certain range and insert, name the range and delete. but i want to make this code dynamic and named E30 as EC.can anybody help me to get the cell address of this cell and range(E30:E60).
below is code for your reference--
Application.EnableEvents = False
With Range("E30:E59")
If Target.Value = "" Then
On Error Resume Next
Range("MyInsertedCells").Delete xlShiftToLeft
Else
.Copy
.Offset(, 1).Resize(, Target.Value).Insert xlShiftToRight
On Error Resume Next
ThisWorkbook.Names("MyInsertedCells").Delete
On Error GoTo 0
.Offset(, 1).Resize(, Target.Value).Name = "MyInsertedCells"
Application.CutCopyMode = False
End If
End With
Application.EnableEvents = True
thanks
I am using following code to copy certain range and insert, name the range and delete. but i want to make this code dynamic and named E30 as EC.can anybody help me to get the cell address of this cell and range(E30:E60).
below is code for your reference--
Application.EnableEvents = False
With Range("E30:E59")
If Target.Value = "" Then
On Error Resume Next
Range("MyInsertedCells").Delete xlShiftToLeft
Else
.Copy
.Offset(, 1).Resize(, Target.Value).Insert xlShiftToRight
On Error Resume Next
ThisWorkbook.Names("MyInsertedCells").Delete
On Error GoTo 0
.Offset(, 1).Resize(, Target.Value).Name = "MyInsertedCells"
Application.CutCopyMode = False
End If
End With
Application.EnableEvents = True
thanks