MD011
10-02-2015, 07:22 AM
Good afternoon everyone,
I currently have the below code which deletes all the text out of that column except for the text in the cell i have selected when i run the macro:
Sub Clear_data_From_Selected_Column()
Dim lastRow, uCol, uRow As Long
lastRow = Cells.Find("", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
uCol = ActiveCell.Column
uRow = ActiveCell.Row
Range(Cells(uRow + 1, uCol), Cells(lastRow, uCol)).Select
Selection.ClearContents
End Sub
I need to make a couple of additions to this macro so that it does the following:
I need the macro to insert a blank row above the current cell, and insert the text "Removed" (in red font if possible?) into the cell above the current cell in the newly created row.
However if there already is a blank row above, i need the macro to simply just insert the "Removed" text rather than adding another blank row.
I hope that makes sense and thank you for the help in advance.
Thanks.
I currently have the below code which deletes all the text out of that column except for the text in the cell i have selected when i run the macro:
Sub Clear_data_From_Selected_Column()
Dim lastRow, uCol, uRow As Long
lastRow = Cells.Find("", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
uCol = ActiveCell.Column
uRow = ActiveCell.Row
Range(Cells(uRow + 1, uCol), Cells(lastRow, uCol)).Select
Selection.ClearContents
End Sub
I need to make a couple of additions to this macro so that it does the following:
I need the macro to insert a blank row above the current cell, and insert the text "Removed" (in red font if possible?) into the cell above the current cell in the newly created row.
However if there already is a blank row above, i need the macro to simply just insert the "Removed" text rather than adding another blank row.
I hope that makes sense and thank you for the help in advance.
Thanks.