Hi Anyone
My range is from "C2 : F16"
As of now i am deleting particular range of cells in a row.
i've used the following code to delete the particular range of cells in a row which is working fine
<code>
What i want is whenever i delete the range of particular cells of that particular row using above code. i dont want any rows below row 17 to shift upwards.
How can i lock this. Only cells should shift upwards between range "C2: F16" for eg if i am in row 6 i.e "C6: F6" i delete all the contents here
then from range "C7:F16" should only shift upwards.
But the Contents from "A17 to G17" should remain intact in row 17. and rows below should remain intact too. Any possibility
Thanks NimishK
My range is from "C2 : F16"
As of now i am deleting particular range of cells in a row.
i've used the following code to delete the particular range of cells in a row which is working fine
<code>
Code:
Option Expilict
Public curRow as integer
Private Sub UserForm_Initialize()
curRow = 2
With Sheets("DealerDetails")
.Activate
text1.Text = .Cells(curRow, 3).Value
text2.Text = .Cells(curRow, 4).Value
text3.Text = .Cells(curRow, 5).Value
text4.Text = .Cells(curRow, 6).Value
End with
End sub
Private Sub cmdDelete_Click()
With Sheets("Sheet2")
If .Range("C" & curRow) = "" Then
Application.Cells(curRow, 3).Delete Shift:=xlUp
Application.Cells(curRow, 4).Delete Shift:=xlUp
Application.Cells(curRow, 5).Delete Shift:=xlUp
Application.Cells(curRow, 6).Delete Shift:=xlUp
Else
Application.Cells(curRow, 3).Delete Shift:=xlUp
Application.Cells(curRow, 4).Delete Shift:=xlUp
Application.Cells(curRow, 5).Delete Shift:=xlUp
Application.Cells(curRow, 6).Delete Shift:=xlUp
End If
End with
End Sub
</code>
How can i lock this. Only cells should shift upwards between range "C2: F16" for eg if i am in row 6 i.e "C6: F6" i delete all the contents here
then from range "C7:F16" should only shift upwards.
But the Contents from "A17 to G17" should remain intact in row 17. and rows below should remain intact too. Any possibility
Thanks NimishK
Last edited: