Stopping code from filling all cells

Status
Not open for further replies.

Alvaroro84

Board Regular
Joined
May 13, 2022
Messages
65
Office Version
  1. 2016
Platform
  1. Windows
My question is how do I stop the code in the bottom from filling up everything in that column
Sub Legal()
With Worksheets("Master").Range("A1")
.AutoFilter field:=10, Criteria1:="RTO", Operator:=xlAnd
End With
With Columns("A").SpecialCells(xlConstants)
.Offset(1, 10).Resize(.Rows.Count - 1).Value = "SNAP"
End With
' add a reset filter
Worksheets("Master").AutoFilterMode = False

With Worksheets("Master").Range("A1")
.AutoFilter field:=10, Criteria1:="CL03", Operator:=xlAnd
.AutoFilter field:=13, Criteria1:="0", Operator:=xlAnd
End With

'when it gets to this area the filter show that nothing fill this criteria so it only shows the title in column one
With Columns("A").SpecialCells(xlConstants)
.Offset(1, 10).Resize(.Rows.Count - 1).Value = "No "
End With
' after running this part it turn all columns into No for row 11.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
My question is how do I stop the code in the bottom from filling up everything in that column
Sub Legal()
With Worksheets("Master").Range("A1")
.AutoFilter field:=10, Criteria1:="RTO", Operator:=xlAnd
End With
With Columns("A").SpecialCells(xlConstants)
.Offset(1, 10).Resize(.Rows.Count - 1).Value = "SNAP"
End With
' add a reset filter
Worksheets("Master").AutoFilterMode = False

With Worksheets("Master").Range("A1")
.AutoFilter field:=10, Criteria1:="CL03", Operator:=xlAnd
.AutoFilter field:=13, Criteria1:="0", Operator:=xlAnd
End With

'when it gets to this area the filter show that nothing fill this criteria so it only shows the title in column one
With Columns("A").SpecialCells(xlConstants)
.Offset(1, 10).Resize(.Rows.Count - 1).Value = "No "
End With
' after running this part it turn all columns into No for row 11.
My intention with this code is to filter and to add "No" to whatever the filter outputs in a specific column .
 
Upvote 0
Please stop posting the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

Thread closed.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,111
Messages
6,123,159
Members
449,098
Latest member
Doanvanhieu

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