+ Reply to Thread
Results 1 to 3 of 3

Macro to insert/delete partial rows on another sheet based on cell value without filtering

  1. #1
    Registered User
    Join Date
    03-13-2013
    Location
    Wichita,KS
    MS-Off Ver
    365 Aps for Enterprise
    Posts
    60

    Macro to insert/delete partial rows on another sheet based on cell value without filtering

    I have looked at several other posts, on copying/pasting based on cell value, but can't seem to modify the macros to work. I am pretty new to macros. When user adds a quantity to a specified row(s) in Column A, data is automatically transferred to Sheet 1:

    If the user selects 1 each of the "drumstick" & "Half gallon of vanilla" options, then two new rows will be inserted on Sheet 1 and data from columns A, B, E, & F of the specified rows will be pasted to the new rows. If the quantities are deleted then the new rows (with data) on sheet 1 are removed.

    Notes: Sheet 2 cannot be filtered or modified because of existing code.

    Please see the attached workbook for more detail.

    Thanks in advance- for your help.
    Attached Files Attached Files
    Last edited by Marvelous; 10-30-2013 at 07:37 PM. Reason: removed picture - see attached.

  2. #2
    Registered User
    Join Date
    03-13-2013
    Location
    Wichita,KS
    MS-Off Ver
    365 Aps for Enterprise
    Posts
    60

    Re: Macro to insert/delete partial rows on another sheet based on cell value without filte

    Bump no response

  3. #3
    Registered User
    Join Date
    03-13-2013
    Location
    Wichita,KS
    MS-Off Ver
    365 Aps for Enterprise
    Posts
    60

    Re: Macro to insert/delete partial rows on another sheet based on cell value without filte

    Bump no response

    Maybe this will help.

    SHEET2 has five columns headers:

    Add: ProductOptions Discount List Net Units

    There are five rows of data under the above column headers. The user will add a "1" to the "Add" column if he wants the product option that is in that row. I'm new to VBA and need a macro to perform the following:

    1.) Look in sheet2, range A4:A:8 and count the number of rows with a "1" in them. (Let's say two rows for this example.)
    2.) Insert that number of rows in Sheet1 at Row 30. (two)
    3.) Copy (in the selected two rows only) the values from the "Add", ProductOptions", "Net", & "Units" columns.
    4.) Paste the data in Sheet1, in sequential order, starting at cell A30. (no blank rows or columns.

    Here is what Sheet1 would look like after the insertion.

    ColA ColB ColC ColD
    1 Drumstick ADD: $ 14 Net Ea.
    1 Half Gallon of vanilla ADD: $ 23 Net Ea.

    If a "1" is removed in one of the rows in range A4:A:8 on Sheet2, then I would like that row (along with the data) to be deleted from Sheet1. I would prefer to have this automatically done but if a macro button needs to be clicked for updating then that would be ok.

    Hope this helps and please let me know if this is unclear.

    Thanks in advance for your help!
    Attached Files Attached Files

+ 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. Insert / Delete rows based on cell value
    By duckdodgers in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-30-2012, 04:07 PM
  2. delete certain rows based on their partial cell content
    By WasWodge in forum Excel General
    Replies: 3
    Last Post: 01-30-2011, 02:37 PM
  3. Delete rows based upon partial string
    By Knawl in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-06-2009, 11:37 PM
  4. Macro to delete rows based on partial text
    By rossi_69 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-09-2009, 06:25 PM
  5. Delete Rows based on cell value and then Insert rows alternatively with a formula
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-11-2008, 04:27 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