LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Inserting rows and adding to total worksheet

Hi
I have been looking at the various answers already suggested but havent
quite got the answer I need.

I have a workbook with a multiple sheet and a totals sheet.

When i add a line to the individual sheet i need to also add it to the total
sheet. I have created a macro to do this, but it is using absolute values
instead of relative ones. How can i change this - a cut down version of the
macro is enlosed -


---- finds where i need to insert the row and want to insert above this---
Cells.Find(What:="TOTAL F", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Rows("21:21").Select
Selection.Insert Shift:=xlDown

--- issue here is the absolute cell reference ----
Range("Q20").Select
Selection.Copy
Range("Q21").Select
ActiveSheet.Paste
Range("B21").Select
Sheets("Totals").Select
Application.CutCopyMode = False
ActiveSheet.Unprotect

---- finds where i can add the line to the 'Totals' sheet----

Cells.Find(What:="TOTAL F", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
--- again goes to absolute cell ----

Range("A18").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A19").Select
Application.CutCopyMode = False
Selection.EntireRow.Insert
Range("C18:H18").Select
Selection.AutoFill Destination:=Range("C18:H19"), Type:=xlFillDefault
Range("C18:H19").Select
Range("A19").Select
ActiveCell.FormulaR1C1 = "='Aug 08 - Oct 08'!R[2]C[1]"
Range("A19").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Aug 08 - Oct 08").Select
End Sub

Hope this is clear and thanx in advance

SU
 
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
Inserting Multiple Rows Throughout Worksheet Tabby Excel Worksheet Functions 1 March 12th 08 09:21 PM
Inserting rows in worksheet P.hamsa Excel Discussion (Misc queries) 4 August 6th 07 09:46 AM
Adding total from one worksheet to another rn2pacu Excel Worksheet Functions 2 May 9th 07 01:10 AM
INSERTING ROWS IN PROTECTED WORKSHEET TLAngelo Excel Discussion (Misc queries) 0 July 18th 06 06:18 PM
adding rows of hours and minutes to get a total Tipps Excel Worksheet Functions 1 November 4th 05 07:03 PM


All times are GMT +1. The time now is 04:43 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"