VB macro to delete row if one column does not have string

MarkinhusZN

New Member
Joined
Jan 10, 2019
Messages
2
Hello All,
I've been breaking my head to solve an issue with powershell, and figured excel would've been the easier way.

I need a vb macro that would look at Column B, it would go through all 2900 records in Column B and compared it to a Text File I have of 591 users. If the value in Column B does not equal to the value I have on Text file then delete the row.
I have tried some macros around but they usually only work with a single string and since I am not savy with vb code, I do not know how to make it read from file. I can also post the strings on the vb macro but it always give syntax error. Please save me lol.
I appreciate all the help
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
The text file content is a list of words, right?
Can you manually copy and paste the list into a worksheet? Say, to sheet2 col A.
If yes, I think I can write a macro to do the job.
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,048
Latest member
81jamesacct

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