|
|
|
|
Junior Member
|
|
Nov 12, 2009, 01:23 PM
|
|
Specific task: Insert rows into existing table
Specific task. See Attachment.
Thanks!
|
|
|
Junior Member
|
|
Nov 12, 2009, 02:11 PM
|
|
NO other spreadsheets. FIGURE 1 reprsent table before inserting rows and FIGURE 2 after that.
|
|
|
Software Expert
|
|
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.
|
|
|
Junior Member
|
|
Nov 13, 2009, 12:47 PM
|
|
Error. See below.
|
|
|
Junior Member
|
|
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!
|
|
|
Software Expert
|
|
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.
|
|
|
Junior Member
|
|
Nov 13, 2009, 04:03 PM
|
|
NO, it surely me.Try this one.
|
|
|
Software Expert
|
|
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
|
|
|
Junior Member
|
|
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!
|
|
|
Software Expert
|
|
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.
|
|
Question Tools |
Search this Question |
|
|
Add your answer here.
Check out some similar questions!
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
|