Hello all,
Can someone modify this code? It does not insert the specified rows in the input box for each selected row, just for one.
Best,Please Login or Register to view this content.
JN
Hello all,
Can someone modify this code? It does not insert the specified rows in the input box for each selected row, just for one.
Best,Please Login or Register to view this content.
JN
Last edited by jeffreybrown; 05-25-2018 at 05:06 PM. Reason: Please use code tags
1. Do you want to insert rows in the selected range, or starting from the active cell ? These are two different things.
If you select the range from "A4" to "A1" the active cell will be "A4", if from "A1" to "A4" the active cell will be "A1".
2. Where is "rowcount" calculated ? No calculations.
3. Where is the "zeilenanzahl" declaration and what for is it ?
4. Where is it from ?
Try:
(rows will be inserted starting from the active cell - two variants)
Please Login or Register to view this content.
Hello Porucha,
Thank you for your reply. I really appreciate it. I'll try your code asap.
Unfortunately, when I translated the code I made a typo, sorry for that. The code looks actually like this:
This code inserts the specified amount of rows after a selected cell. It works perfectly fine. However, I need a bit something else.Please Login or Register to view this content.
1. I would like to select several cells in column A at the same time (strg + select). Those cells can be anywhere in column A, e.g. A21, A34, A45 and so on
2. After selecting the cells I would like to insert after each selected cell a specific amount of rows. The number of rows I would put into the message box. As mentioned before, with the code above I can only insert rows after one selected cell, which would make my doing very time consuming. I read that "activecell" can only be just one row. But is there a workaround?
Let me know if you need further clarifications.
Best,
JN
Last edited by JN12345; 05-24-2018 at 04:59 PM. Reason: Typo
1a,b.
How do you want to do this with this procedure ?
If you select some cells, two ... three ... four cells etc. and then you double-click, then you haven't multiple-selected cells but only one-selected cell, the one you double click. One action excludes this other action.
2. Inserting rows starting from the first cell under the active cell:
Please Login or Register to view this content.
Ok, thank you. I understand that it only works with one selected cell. But is there a workaround to insert the cells right after all selected cells?
In the example below I would like to insert the rows I specified in the input box for all highlighted cells and not only for "UT20". Is this possible with vba?
Untitled.png
Using the menu from the right mouse button:
1. ThisWorkbook module
2. Standard module, Module1:Please Login or Register to view this content.
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks