Deleting rows

azizrasul

Well-known Member
Joined
Jul 7, 2003
Messages
1,304
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
I want to delete rows based values other than specific values. Here's the code I am using which gives me an error on the .Delete line.

Code:
Set ws = ThisWorkbook.Sheets("tblComputerSystemInformation")

With ws.Range("C2:C" & WorksheetFunction.CountA(Range("tblComputerSystemInformation[nametype]")))
        .AutoFilter Field:=4, Criteria1:="Not In ('OSArchitecture','Name','OSLanguage')"
        .SpecialCells(xlCellTypeVisible).Delete
End With

In MS Access you can use criteria like

Code:
Not In ('OSArchitecture','Name','OSLanguage')

Is it possible to do something similar in MS Excel?
 
As I stated earlier that depends on the version of Excel that they have. All recent versions of Excel have Power Query/Get and Transform built in (that is why it is important that you show what version of Excel you have in your profile, if you had a version earlier than 2010 then Power Query wouldn't have been an option).
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
As I stated earlier that depends on the version of Excel that they have. All recent versions of Excel have Power Query/Get and Transform built in (that is why it is important that you show what version of Excel you have in your profile, if you had a version earlier than 2010 then Power Query wouldn't have been an option).
OK I understand.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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