• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Excel Pros, I need you help.

  • Thread starter Thread starter KK
  • Start date Start date

KK

Lifer
I have a spread sheet that consists of columns A-P, and rows 2-26,000 something. I basically want to match column E & F to M & N respectively, if they match on the same row then I would like it to delete that row. To put it in other terms, if E & F don't match M & N respectively then output that row to another sheet. Can this be done in Excel? And if so, how?

Anyone?

TIA,
KK
 
This is very possible with Excel. I poked around in Excels Macro features one afternoon during my summer job, and I can kindof remember what you'd have to do. Now, I don't know how to output to another cell, but I'm going to assume that you don't need the rows that will be deleted. First, declare a variable and set it to 1. Then, set up a while loop such that (x<=SPREADSHEET.ACTIVEROWS). (I know that's not exact, but it should be close to what you want). Then, set up a simple boolean statement such that if (E[x]!=M[x] && F[x]!=N[x]) (exact notation is probably wildly off, as I said I only have one afternoon's experience with Excel), and if that is true, then ROW[x].DELETE. Run a search on google for the exact functions you need to implement my logic. Hope that helps somewhat, as ATOT'ers helped me out a lot when I was in your situation.
 
Originally posted by: Dudd
This is very possible with Excel. I poked around in Excels Macro features one afternoon during my summer job, and I can kindof remember what you'd have to do. Now, I don't know how to output to another cell, but I'm going to assume that you don't need the rows that will be deleted. First, declare a variable and set it to 1. Then, set up a while loop such that (x<=SPREADSHEET.ACTIVEROWS). (I know that's not exact, but it should be close to what you want). Then, set up a simple boolean statement such that if (E[x]!=M[x] && F[x]!=N[x]) (exact notation is probably wildly off, as I said I only have one afternoon's experience with Excel), and if that is true, then ROW[x].DELETE. Run a search on google for the exact functions you need to implement my logic. Hope that helps somewhat, as ATOT'ers helped me out a lot when I was in your situation.

I'll look into that, it sounds pretty simple.

Thanks



KK
 
Originally posted by: KK
Originally posted by: Dudd
This is very possible with Excel. I poked around in Excels Macro features one afternoon during my summer job, and I can kindof remember what you'd have to do. Now, I don't know how to output to another cell, but I'm going to assume that you don't need the rows that will be deleted. First, declare a variable and set it to 1. Then, set up a while loop such that (x<=SPREADSHEET.ACTIVEROWS). (I know that's not exact, but it should be close to what you want). Then, set up a simple boolean statement such that if (E[x]!=M[x] && F[x]!=N[x]) (exact notation is probably wildly off, as I said I only have one afternoon's experience with Excel), and if that is true, then ROW[x].DELETE. Run a search on google for the exact functions you need to implement my logic. Hope that helps somewhat, as ATOT'ers helped me out a lot when I was in your situation.

I'll look into that, it sounds pretty simple.

Thanks



KK


so basically you want something that will make sure the cells in column E are = to M, then F = N correct?
 
Originally posted by: KLin
Originally posted by: KK
Originally posted by: Dudd
This is very possible with Excel. I poked around in Excels Macro features one afternoon during my summer job, and I can kindof remember what you'd have to do. Now, I don't know how to output to another cell, but I'm going to assume that you don't need the rows that will be deleted. First, declare a variable and set it to 1. Then, set up a while loop such that (x<=SPREADSHEET.ACTIVEROWS). (I know that's not exact, but it should be close to what you want). Then, set up a simple boolean statement such that if (E[x]!=M[x] && F[x]!=N[x]) (exact notation is probably wildly off, as I said I only have one afternoon's experience with Excel), and if that is true, then ROW[x].DELETE. Run a search on google for the exact functions you need to implement my logic. Hope that helps somewhat, as ATOT'ers helped me out a lot when I was in your situation.

I'll look into that, it sounds pretty simple.

Thanks



KK


so basically you want something that will make sure the cells in column E are = to M, then F = N correct?

Yes. if E is = to M and F is = to N then I want that particular row deleted.
This is what I got so far
Sub Delete()
For x = 2 To 27000
If E(x) = M(x) & F(x) = N(x) Then Rng.Rows(x).EntireRow.Delete
x = x + 1
Next



End Sub

That's my pitiful attempt. Of course it doesn't work.
Any ideas.

KK
 
Back
Top