+ Reply to Thread
Results 1 to 2 of 2

VBA- add new rows if a condition is met

  1. #1
    Registered User
    Join Date
    02-16-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    1

    VBA- add new rows if a condition is met

    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

  2. #2
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Re: VBA- add new rows if a condition is met

    hi Lanterns20,

    if you could supply with example worksheet. that would be helpfull for me or anyone to try helping you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to delete rows based on a met condition between two rows
    By dijimbob in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-23-2014, 05:11 PM
  2. Delete Rows If condition not met
    By Pasha81 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-17-2009, 02:48 PM
  3. delete rows when the condition is met
    By tweety127 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-14-2008, 09:46 AM
  4. [SOLVED] Hiding rows on condition
    By Catherine Bond in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-23-2006, 01:25 PM
  5. Force condition on all Rows
    By afmullane in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2006, 03:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1