| View previous topic :: View next topic |
| Author |
Message |
Gorky Newbie

Joined: 24 Apr 2007 Posts: 2
|
Posted: Tue Apr 24, 2007 4:42 am Post subject: Help with Calc and inserting new rows |
|
|
Hello,
I have a really big problem which I do not know how to fix. Here is the problem:
- I have data cells with formulas
- Now i need to record a macro that would insert a new row, before my first data row, but the new row should have the same formulas as the next row but no data.
- One formula is: =IF(ISNUMBER(B8 );B8+1;1) and it determinate the "ID". The B8 is the row before that. But when I insert a new row before row B9 it should rename B8 to B9 but it doesn't. All next rows are given the right numbers but the first one still calls B8 which is now not a row above it.
If anyone understands me : ) please, I really need some help.
Cheers,
Gorky |
|
| Back to top |
|
 |
noranthon Super User

Joined: 07 Jul 2005 Posts: 3318
|
Posted: Tue Apr 24, 2007 4:48 am Post subject: |
|
|
Would a simple solution be to copy the formulas rather than re-enter them? _________________ search forum by month |
|
| Back to top |
|
 |
Gorky Newbie

Joined: 24 Apr 2007 Posts: 2
|
Posted: Tue Apr 24, 2007 5:18 am Post subject: |
|
|
| noranthon wrote: | | Would a simple solution be to copy the formulas rather than re-enter them? |
I am copying them. The problem is I gues with relative calling. Because I need to tell macro somehow that when I start it, it should always insert new row at row 8, not where mouse pointer is... Thats one problem. |
|
| Back to top |
|
 |
Mark B Super User


Joined: 16 Feb 2007 Posts: 852 Location: Lincolnshire, UK
|
|
| Back to top |
|
 |
noranthon Super User

Joined: 07 Jul 2005 Posts: 3318
|
Posted: Tue Apr 24, 2007 6:43 pm Post subject: |
|
|
To insert one new row at row 9, you can use something like this: | Code: | 'you must have a definition of oSheet
oSheet.Rows.insertByIndex( 8, 1 ) ' row 9, one row |
_________________ search forum by month |
|
| Back to top |
|
 |
|