kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
1,796
Office Version
  1. 2016
Platform
  1. Windows
I want to clear the content from col B to N instead of deleting entire row.

I can't make it happen.

Can someone fix that for me?

I have tried

Code:
[COLOR=#A52A2A].Offset(1).EntireRow.ClearContents[/COLOR]

But did not work.

Code:
With Range("B3:N"& Range("B" & Rows.Count).End(xlUp).Row)
.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=[O1:O2], Unique:= False 
[COLOR=#a52a2a].Offset(1).EntireRow.Delete[/COLOR]

If .Parent.FilterMode Then .Parent.ShowAllData 

End With
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
Try this

Code:
With Range("B3:N" & Range("B" & Rows.Count).End(xlUp).Row)
    .AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=[O1:O2], Unique:=False
    .Offset(1).ClearContents
    If .Parent.FilterMode Then .Parent.ShowAllData
End With
 

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
1,796
Office Version
  1. 2016
Platform
  1. Windows
Sure!!!

Problem solved.

Regards
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
I'm glad to help you. Thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,501
Messages
5,523,293
Members
409,508
Latest member
Afc

This Week's Hot Topics

Top