Jyotirmaya
Board Regular
- Joined
- Dec 2, 2015
- Messages
- 216
- Office Version
- 2019
- Platform
- Windows
I have a excel sheet where there are many Balance rows. In Column A there are Demand Collection Balance Rows, where Balance = Demand - Collection.
So there are multiple Balance Rows are there in that sheet. Column FGHIJ are inter related.
I want a macro that if in any Balance row there are negative value in FGHI column followed by any positive value a new row will be insert above the balance row.
for example
1. there is a negative value in F column -100 and positive value in either G or H or I or J column
2. there is a negative value in G column -100 and positive value in either H or I or J column
3.there is a negative value in I column -100 and positive value in either I or J column
4.there is a negative value in I column -100 and positive value in J column
In the above situation a blank row should be insert over the Balance row
If there is any positive value in F column but negative value in G column then row should not be insert.
example 40 -100 0 0 0 in FGHIJ column
Another example 40 -100 20 30 40
Here a new row should be inserted because the negative value is followed by positive values in the column
A new row should insert only if a negative value is followed by a positive value in in F G H I J column serially from left to right.
I want a VBA macro to insert rows above the Balance Row where the condition fulfills
Kindly check the image to understand better, in the blue marked columns a new row should insert as it fulfills the criteria but in the yellow marked columns it should not as the negative value doesn't followed by a positive value.
So there are multiple Balance Rows are there in that sheet. Column FGHIJ are inter related.
I want a macro that if in any Balance row there are negative value in FGHI column followed by any positive value a new row will be insert above the balance row.
for example
1. there is a negative value in F column -100 and positive value in either G or H or I or J column
2. there is a negative value in G column -100 and positive value in either H or I or J column
3.there is a negative value in I column -100 and positive value in either I or J column
4.there is a negative value in I column -100 and positive value in J column
In the above situation a blank row should be insert over the Balance row
If there is any positive value in F column but negative value in G column then row should not be insert.
example 40 -100 0 0 0 in FGHIJ column
Another example 40 -100 20 30 40
Here a new row should be inserted because the negative value is followed by positive values in the column
A new row should insert only if a negative value is followed by a positive value in in F G H I J column serially from left to right.
I want a VBA macro to insert rows above the Balance Row where the condition fulfills
Kindly check the image to understand better, in the blue marked columns a new row should insert as it fulfills the criteria but in the yellow marked columns it should not as the negative value doesn't followed by a positive value.