Hello,
I have a situation that requires a button to insert 10 formated rows and some formulas above the button when it's pressed.
I attached an example but without any macro code as I have to admit I don't know VBA.
I need the button to insert in the table new rows identical to existing rows 5 to 14 (formated and with formulas that are on columns F and M) every time the button is pressed.
Basicaly the button will add to the table another 10 rows identicaly to the ones above.
If anyone help me with this I would appreciate it.
Thanks,
Alex
EDIT:
Well... I think I got something... but it always inserts in the same position instead of before the button
I named the range A5:N14 as "nou" (I also modified the attached example with the above macro).Code:Sub Test() Range("nou").Offset(0).EntireRow.Select Selection.Copy Range("nou").Offset(10).EntireRow.Select Range("nou").Offset(10).EntireRow.Insert Application.CutCopyMode = False End Sub
So the problem now is this part:
Whitch inserts the copied cells below the range. How can I link the insertion to the position of the button and have it insert it 10 rows above the button?Code:Range("nou").Offset(10).EntireRow.Select Range("nou").Offset(10).EntireRow.Insert
EDIT:
Ok I aslo figured it out: I defined a new name for the cells behind the button and changed the select and insert to the button named range.
The last problem I have (but not a major one) is if there is any way to copy only the structure and formulas not the manualy inserted data...
Last EDIT:
Well solved that too
I marked the topic as solved. Thanks everyone![]()
Last edited by alexandruc; 03-17-2010 at 05:02 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks