VBA- add new rows if a condition is met (excel2007)

Lanterns20

New Member
Joined
Feb 14, 2014
Messages
2
Hi,
I am new to VBA and I would appreciate any help on this. My question is how can I write a routine to add rows in one Sheet if a condition which involves a different Sheet is met (excel 2007).

In Sheet 1 is a list of ("liquid") names (cells C4:C26) which will need to be expanded should the IF condition be satisfied. In row 27 I have a subtotal (whihc is using data from columns D onwards), and from row 29 down cells are not empty.

The condition I want to verify is in Sheet 4-column I, where it is reported whether a name is classified as "liquid" or "illiquid". If the number of "liquid" names in sheet4-column I is more than the number of names in Sheet1-C4:C26 I would like to add as many rows as the difference between the two lists. Also I would like to make sure that the subtotals that I have in row 27 (and that will be shifted down when new rows are added) will also inlcude the data in the new rows (the subtotal is taking data from columns D onwards).

Should the code need to inlcude the name of the tabs, Sheet 1 is called Summary and Sheet 4 CDS Data

Thank you
 

Some videos you may like

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

sijpie

Well-known Member
Joined
Nov 1, 2008
Messages
3,661
Why are you double posting this without reacting to the reply in your first post?

http://www.mrexcel.com/forum/excel-...plications-add-new-rows-if-condition-met.html

Double posting is very impolite. Also if you post the same question on another forum, then please put links in both posts so people can see what has been done and said about the issue. You are asking people's help, time and effort, so please respect that.

Do not reply any further to this thread, please continue in the original thread, link above.
 

Watch MrExcel Video

Forum statistics

Threads
1,099,096
Messages
5,466,628
Members
406,493
Latest member
Hazem Hassan

This Week's Hot Topics

Top