Results 1 to 5 of 5

How to insert rows depending on value of a reference cell?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-18-2020
    Location
    Ottawa, ON
    MS-Off Ver
    Professional Plus 2010
    Posts
    132

    Lightbulb How to insert rows depending on value of a reference cell?

    Hi Everyone!

    I'm looking for a fix (possibly VBA code, or whatever else will work) that will DELETE rows in multiple sheets in multiple areas depending on the value of a reference cell.

    My spreadsheet is set up so that someone enters some information regarding a shipment of goods, and then that information is transferred to multiple different sheets to create shipping documents. These documents are then automatically saved as PDF files and sent to myself in an email. The issue is that, depending on the number of "Goods" I'm shipping (the maximum being 6), I would like to have rows in these shipping documents automatically deleted to shorten the length of the document and not create 'blank space' in them. I'm electing for deleting rows (rather than adding) since of course these rows have formulas to carry over the data from the "Input" tab.

    Example: If, in the Input tab, it's noted that there are 4 goods being shipped, perhaps I click a button to run the macro/VBA code, which then deletes the unnecessary rows in each of these shipping documents. I've added some photos to make things more clear:

    Let's say I have chosen 3 x goods to be shipped. After running the code, it would go into "Document #1" (PHOTO#1) and delete rows 25, 26, & 27, leaving only rows 22, 23, and 24 with the data of the goods being shipped. It would also go into "Document #2" (PHOTO #2) and delete rows 22:24, 30:32, and 38:40. The row placement will always be the same in each of these documents.

    I've also attached the workbook itself if that makes it easier to understand. Will greatly appreciate anybody's help with this, and if this turns into being a lot of work I'm happy to pay for it.. $10, $20 or whatever you guys/gals think this is worth. I have gotten a lot of help from this site and I am beginning to feel bad as I have not been able to offer much in return to date. I am doing my very best to learn how to code but it is hard!!
    Attached Images Attached Images
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA to Insert Formatted Rows Based On Cell Reference
    By hindotmo12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2020, 06:03 PM
  2. [SOLVED] VBA / copy & insert rows with specific columns depending on cell value
    By thedefense in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2017, 11:09 AM
  3. Insert new rows, keep cell reference in another worksheet. INDIRECT does not work
    By dazedandconfusedd in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 01-18-2016, 09:39 PM
  4. [SOLVED] Insert multiple rows depending on cell value
    By AR-51 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-03-2013, 04:18 AM
  5. Replies: 14
    Last Post: 11-14-2012, 11:24 AM
  6. macro: insert specified number of rows depending on referenced cell value
    By cffurillo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-24-2012, 11:37 AM
  7. Auto insert 'x' rows depending on value 'y'
    By nephilim3uk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-13-2010, 09:49 AM

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