Hello People.. I have a macro which is doing what I want it to do. I would like to either change part of it, or at least know why it's working.
The highlighted in red line seems to work by finding the last cell in a column that is below the freeze line & if it is empty, unloads the macro. If it's not, the macro runs & deletes the data.
My question is, is that normal? Is that what it's supposed to do? I would have expected it to go above the freeze line & delete the contents in the cells above.
Otherwise I'll adapt it to go up to & include row 13 only
Thanks
Private Sub DeleteLong() Dim Scr As Long Const strPassword As String = "IdHav2KillU" 'Un-Protect Worksheet---------------------------------------------- ActiveSheet.Unprotect Password:=strPassword ' Scroll page to see the data deleted Scr = Range("C" & Rows.Count).End(xlUp).Offset(1, 5).Select ActiveWindow.SmallScroll down:=Scr ' Test if row is empty & close macro if it is-------------------------- If Range("C" & Rows.Count).End(xlUp) = "" Then Unload Me ActiveSheet.Protect Password:=strPassword Exit Sub Else End If ' Deleter Macro to delete the contents ' of the bottom cell in column C & 4 cells to the right With Range("C" & Rows.Count).End(xlUp) .ClearContents .Offset(, 1).Resize(1, 3).ClearContents End With Unload Me 'Re-Protect Worksheet---------------------------------------------- ActiveSheet.Protect Password:=strPassword End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks