+ Reply to Thread
Results 1 to 5 of 5

Macro that adds or removes row based ont first cell selection.

  1. #1
    Registered User
    Join Date
    06-06-2017
    Location
    Koper
    MS-Off Ver
    2007
    Posts
    19

    Macro that adds or removes row based ont first cell selection.

    Hello all,

    I would need quite a bit of help in figuring out how to make this kind of macro.
    The basic idea is that the macro has to copy values from "sheet1" to "sheet 2" and depending on how many cells are selected to format "sheet 2".

    The long explenation is that I want to select just the first cells in specific rows (A2,A8,A9-other are filtered out) then it should copy from colum A to colum P of the selceted row and paste it to the target sheet. In the target sheet it should add or remove rows depending on my selection and paste colum values from A to M colum O and P go to diferent areas since they are fixed values for all of the selected rows.

    I'm attaching an excel file that shows my problem better.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: Macro that adds or removes row based ont first cell selection.

    MaritimeRob

    From your post and your workbook sample, it's not clear a couple of things:

    .- when you say
    I want to select just the first cells in specific rows (A2,A8,A9
    are these cells selected all together at once, or just one by one?

    In the target sheet it should add or remove rows depending on my selection
    where to add: at the bottom?, between such and such? , other?
    what to remove?
    Barriers are there for those who don't want to dream

  3. #3
    Registered User
    Join Date
    06-06-2017
    Location
    Koper
    MS-Off Ver
    2007
    Posts
    19

    Re: Macro that adds or removes row based ont first cell selection.

    Oh sorry for the missunderstanding.
    What i meant is that the cells are selected all at once.

    To add or remove should be on the target sheet between row 10 and row 30(or more depending on how many row's are selected in the first sheet.)
    The reason for this that on the Loading order the head of the doc takes the first 10 rows (loading place, truck number) and the foot of the document also takes 10 rows(signature, stamp, destination).

    Remove whas meant in the sense that the document should not contain uneccesary empty rows.

  4. #4
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: Macro that adds or removes row based ont first cell selection.

    Here you have a workbook with a macro
    I hope it Does what you need

    Take care to select only one cell each time, using Control Click
    following your example column M in "start" is not copied.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-06-2017
    Location
    Koper
    MS-Off Ver
    2007
    Posts
    19

    Re: Macro that adds or removes row based ont first cell selection.

    Omg thank you
    This is perfect!

+ 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. Macro Removes the duplicates based in one part of the information
    By PaulaGon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2017, 03:41 PM
  2. Macro that removes word based on characters in cell
    By wonderd in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-19-2015, 10:07 PM
  3. [SOLVED] Macro adds number to entire selection, how to avoid adding to blank cells?
    By Butcher1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2014, 03:05 PM
  4. [SOLVED] lookup that adds up the sum product based on another cell.
    By perky derky in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-14-2013, 05:42 AM
  5. [SOLVED] Macro that removes rows based on frequency and copies part of the row to a new sheet
    By njmiller31 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-28-2012, 05:32 PM
  6. Replies: 0
    Last Post: 12-22-2011, 03:42 PM
  7. Adds text in one cell based on two other cells
    By tex3285 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-12-2011, 05:32 PM

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