Quick Clear Column tool

Loadlucas

New Member
Joined
Jun 29, 2022
Messages
10
Office Version
  1. 2019
Platform
  1. Windows
Hi,

I'm searching a quickly way to clear a column starting at the 7th row until the end of the data in row 13.

Here is my macro, who's working but too slow (20 sec. to clear 10 rows !) :

VBA Code:
        Sub ClearCol_N()
        x = ActiveSheet.Name
            With ThisWorkbook.Worksheets(x)
                n = .Cells(.Rows.Count, 13).End(xlUp).Row
                Application.ScreenUpdating = False
                For I = 7 To n
                    .Cells(I, 14).ClearContents
                Next I
            End With
        End Sub

Any idea will be great !

Thank you

Loadlucas
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
End of data in row 13?

If you want to clear N7 down to the last row in Column M

VBA Code:
    Dim x As Worksheet
    Set x = ActiveSheet
    With x
        .Range("N7:N" & .Cells(.Rows.Count, "M").End(xlUp).Row).ClearContents
    End With
 
Upvote 0
End of data in row 13?

If you want to clear N7 down to the last row in Column M

VBA Code:
    Dim x As Worksheet
    Set x = ActiveSheet
    With x
        .Range("N7:N" & .Cells(.Rows.Count, "M").End(xlUp).Row).ClearContents
    End With
Thank you !

Is it possible to replace N with ActiveCell.Column ?

Thank you
 
Upvote 0
How about
VBA Code:
Sub Loadlucas()
   With ActiveCell
      Range(Cells(7, .Column), Cells(Range("M" & Rows.Count).End(xlUp).Row, .Column)).ClearContents
   End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,538
Messages
6,114,218
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top