Ask Experts Questions for FREE Help !
Ask
    Pajoooo's Avatar
    Pajoooo Posts: 60, Reputation: 1
    Junior Member
     
    #1

    Nov 12, 2009, 01:23 PM
    Specific task: Insert rows into existing table
    Specific task. See Attachment.

    Thanks!
    Attached Files
  1. File Type: xls Book1.xls (21.5 KB, 180 views)
  2. Pajoooo's Avatar
    Pajoooo Posts: 60, Reputation: 1
    Junior Member
     
    #2

    Nov 12, 2009, 02:11 PM

    NO other spreadsheets. FIGURE 1 reprsent table before inserting rows and FIGURE 2 after that.
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #3

    Nov 12, 2009, 06:01 PM
    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.
    Pajoooo's Avatar
    Pajoooo Posts: 60, Reputation: 1
    Junior Member
     
    #4

    Nov 13, 2009, 12:47 PM
    Error. See below.
    Pajoooo's Avatar
    Pajoooo Posts: 60, Reputation: 1
    Junior Member
     
    #5

    Nov 13, 2009, 12:49 PM
    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!
    Attached Files
  3. File Type: xls Book2.xls (17.5 KB, 161 views)
  4. JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #6

    Nov 13, 2009, 03:08 PM

    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.
    Pajoooo's Avatar
    Pajoooo Posts: 60, Reputation: 1
    Junior Member
     
    #7

    Nov 13, 2009, 04:03 PM
    NO, it surely me.Try this one.
    Attached Files
  5. File Type: xls Book3.xls (19.5 KB, 188 views)
  6. JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #8

    Nov 14, 2009, 11:00 AM

    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
    Attached Files
  7. File Type: xls InsertMacro-Book3.xls (27.0 KB, 177 views)
  8. Pajoooo's Avatar
    Pajoooo Posts: 60, Reputation: 1
    Junior Member
     
    #9

    Nov 15, 2009, 12:34 PM
    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!
    Attached Files
  9. File Type: xls Book4.xls (26.5 KB, 181 views)
  10. JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #10

    Nov 16, 2009, 12:02 AM

    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.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

How to Knit Short Rows? [ 1 Answers ]

How do you knit short rows? I am confused on how to wrap around stitches.

Combine rows of text into one cell [ 12 Answers ]

Hi everyone I hope you are all well! I have an excel problem and it would be much appreciated if someone has the time to take a look... In column A I have product names, in B I have product categories and in C:H the product categories from column B are titles and the name of the subcategory...


View more questions Search