ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional Delete Statement (https://www.excelbanter.com/excel-worksheet-functions/265928-conditional-delete-statement.html)

chrisjack001

Conditional Delete Statement
 
I want to create a code that can run through the entire Excel spreadsheet and delete the rows of all accounts that have $0 or less Outstanding amt in column K. Example in the below sample account 31203 started with an outstanding balance of $3000 but had two transactions that followed in Column J resulting in an ending balance of $0. As a result of this all rows of account 31203 should be deleted and the rest of the remaining data should be moved up. All accounts that have Outstanding balances in column K like account # 76292 & 56512 in the example below will Not be deleted because they have balances of $2500 and $3800 respectively. The only Accounts that will remain on the spreadsheet will be account numbers with Outstanding balances in the Outstanding Amt field in column K. Can you please help me create a macro or a VBA code to accomplish this task I am new at this. Sorry I had to present my case this way because when I try to copy and paste it the way I have it in Excel comes out all clumped together in this medium. If you put them side by side you will see what it should look like. Thanks for your help.

A
Account
31203
31203
31203
76292
56512

J
Encumb Amt
Blank field
$1000
$2000
Blank field
Blank field

K
Outstanding Amt
$3000
$2000
$0
$2500
$3800


All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com