Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Specific task: Insert rows into existing table (https://www.askmehelpdesk.com/showthread.php?t=415404)

  • Nov 12, 2009, 01:23 PM
    Pajoooo
    1 Attachment(s)
    Specific task: Insert rows into existing table
    Specific task. See Attachment.

    Thanks!
  • Nov 12, 2009, 02:11 PM
    Pajoooo

    NO other spreadsheets. FIGURE 1 reprsent table before inserting rows and FIGURE 2 after that.
  • Nov 12, 2009, 06:01 PM
    JBeaucaire
    Pajoo, your needs are not clear. There is no explanation of why the values in Figure 2 were inserted.

    If this is just a random process, it will be manual.

    Also, your use of merged cells for each row not only makes no sense (you can use a single row and simply expand the row height to attain the exact same appearance) but your use of merged cells will interfere with any macro-type assistance we try to offer.

    VBA and merged cells do not play nicely with each other. Plus, as I've already said, your table layout gains nothing from the merged cells. The same layout can be attained without them.
  • Nov 13, 2009, 12:47 PM
    Pajoooo
    Error. See below.
  • Nov 13, 2009, 12:49 PM
    Pajoooo
    1 Attachment(s)
    Why the values in Figure 2 were inserted?

    Figure 1 is part of larger project that has predefined tables with predefined numbers of rows. Sometimes, really sometimes, table need additional rows and red bordered method (attachment) is acceptable for me.

    Forget merged cells.

    Thanks!
  • Nov 13, 2009, 03:08 PM
    JBeaucaire

    The red bordered method is not an explained method. It's just a table of letters that don't match anything you've shown in table 1 or table 2.

    I can't remember the last time I had this much trouble understanding what someone was trying to do. Sorry, it must be me.
  • Nov 13, 2009, 04:03 PM
    Pajoooo
    1 Attachment(s)
    NO, it surely me.Try this one.
  • Nov 14, 2009, 11:00 AM
    JBeaucaire
    1 Attachment(s)

    Maybe this:
    Code:

    Option Explicit

    Sub InsertRows()
    'JBeaucaire  (11/14/2009)
    Dim Cnt As Long

    Cnt = Application.WorksheetFunction.CountA(Range("N5:N14"))

    If Cnt = 0 Then Exit Sub

    Range("A13:K" & 12 + Cnt).Insert Shift:=xlDown
    Range("N5:N" & 4 + Cnt).Copy Range("F13")
    Range("N5:N14").ClearContents

    End Sub

  • Nov 15, 2009, 12:34 PM
    Pajoooo
    1 Attachment(s)
    All work fine, but...

    Print layout after added rows is not same. How erase number of added rows below double red line.
    If I insert, for example, 5 rows, same number of rows (5) I need to erase below double red line.

    Thanks!
  • Nov 16, 2009, 12:02 AM
    JBeaucaire

    I can't see how this sample sheet and question relates the to the prior question in any way.

    Perhaps this completely different need deserves a thread of its own, it's clear you're starting completely over from what we did above.

  • All times are GMT -7. The time now is 12:40 PM.