Leedo
Leedo

Reputation: 611

How to use End(xlUp) to clear all rows starting from cell A4

The below code clear all cells on column A starting from cell A4. Please, How to adapt this code to clear all rows starting from cell A4.

Range("A4", ActiveSheet.Range("A" & ActiveSheet.Rows.count).End(xlUp)).Clear

Upvotes: 0

Views: 132

Answers (1)

Siddharth Rout
Siddharth Rout

Reputation: 149295

One method is given by @GSerg in the comment above.

Here is another way (Shorter code)

Dim ws As Worksheet
Set ws = ActiveSheet '<~~ OR Change this to the relevant sheet

ws.Rows("4:" & ws.Rows.Count).Clear

Upvotes: 4

Related Questions