Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default insert rows programmatically with formula change

Is inserting rows in the middle of a group something the user would normally
be doing?

Mike F
"Newbie" wrote in message
...
That is ok when copying the whole group however if they want to insert a
row within the group the formula needs to have the $ sign so that it
refers to the group header.

"Mike Fogleman" wrote in message
. ..
Then remove the $ signs from the formulas yourself, before you give it to
them. The $ was for your convenience when you drag down the formulas.
Once the formulas are in place the $ signs are no longer needed.

Mike F
"Newbie" wrote in message
...
Thanks for this. This would be ok if I was doing the copying. This is
a spreadsheet that is used by people that have no knowledge of excel and
therefore editing to formulas is not a solution unfortunately.
It needs to be 'fool' proof

Thanks again
"Mike Fogleman" wrote in message
. ..
It has to do with the $ sign in the formula. You used A2*A$1 in row 2
so you could drag down the formula to row 4, and all formulas would
refer to row 1 (absolute). Now when you move this section you will want
to remove the $ before you copy it. That way they will reference the
new rows that it is pasted to (relative). To quickly do that select
B2:B4 and hit Ctrl+H (replace with). Replace what: $, Replace with:
(leave blank), click replace all. Now you can copy your formulas to
anywhere and their relationship remain intact.

Mike F
"Newbie" wrote in message
...
I have a spread sheet that is grouped where the top line of the group
determines the Qty of Item and the Total value for the item

eg 1 Table (row 1) requires 1 table top, 2 chairs and 4 legs (rows 2
to 4) if I change the qty in Row 1 (i.e. No of Tables) the parts
automatically change as well.

eg
Col A B C D E
Qty Unit
formula Rate Value
Total
Row 1 1 300
Row 2 2 A2*A$1 50 100
Row 3 1 A3*A$1 100 100
Row 4 4 a4*A$1 25 100


I want to be able to copy this grouping so that the formula in column
B (the A$1 part) always refers to the relative Row 1 of the group i.e
if I copy and insert the group at Row 6 the formula in Row 6 would
change to A7 * A$6 etc

Is there a way of using a command button to copy the group and then
paste it into the spreadsheet at the row that has been selected and
then update the formula in the rows with the row number of the
insertion point

eg it copies the group , I then select row 13 as the insertion point,
this row number is stored in a variable, so that the formula in row
14, 15 and 16 is updated to A14*A$13, A15*A$13 and A16*A$13

I do have some knowledge of VBA but in Access not Excel so a dummies
guide would be much appreciated to any solution that may be offered

Thanks











Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
insert rows in a worksheet that do not change adjoining rows craigandmel Excel Discussion (Misc queries) 2 April 29th 08 10:26 PM
Function to insert rows on a change in a cell Subhash Excel Discussion (Misc queries) 3 March 19th 08 04:35 AM
How to insert rows based on change in data Leoc Excel Worksheet Functions 2 January 23rd 08 10:12 PM
programmatically change pivot table rows/columns [email protected] Excel Programming 0 August 25th 05 05:33 AM
programmatically insert multiple blank rows in worksheet tag Excel Programming 3 July 31st 03 05:03 AM


All times are GMT +1. The time now is 11:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"