Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Adding a Value from one worksheet to another.

I have tried making sense of the code from the Macro when I recorded it
but it isnt working for me.

Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-14]+'07-Dec-06'!RC"
Range("Q7").Select

This works but I need to apply it to multiple worksheets so I need it
to be more dynamic in the sense that it doesnt reference '07-Dec-06'
but something along the lines of

Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-14]+'Sheets(ActiveSheet.Index -
1)'!RC"
Range("Q7").Select

Or some way of selecting the previous worksheet then the one I am on
and doing a calculation in a cell.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Adding a Value from one worksheet to another.

Maybe this

Range("Q6").FormulaR1C1 = "=RC[-14]+'Sheets(" & _
Worksheets(ActiveSheet.Index - 1).Name & ")'!RC"
Range("Q7").Select


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"newguy" wrote in message
oups.com...
I have tried making sense of the code from the Macro when I recorded it
but it isnt working for me.

Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-14]+'07-Dec-06'!RC"
Range("Q7").Select

This works but I need to apply it to multiple worksheets so I need it
to be more dynamic in the sense that it doesnt reference '07-Dec-06'
but something along the lines of

Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-14]+'Sheets(ActiveSheet.Index -
1)'!RC"
Range("Q7").Select

Or some way of selecting the previous worksheet then the one I am on
and doing a calculation in a cell.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Adding a Value from one worksheet to another.

That gets the formula in the cell now everytime I run it, it asks me to
save the file.


Bob Phillips wrote:
Maybe this

Range("Q6").FormulaR1C1 = "=RC[-14]+'Sheets(" & _
Worksheets(ActiveSheet.Index - 1).Name & ")'!RC"
Range("Q7").Select


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"newguy" wrote in message
oups.com...
I have tried making sense of the code from the Macro when I recorded it
but it isnt working for me.

Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-14]+'07-Dec-06'!RC"
Range("Q7").Select

This works but I need to apply it to multiple worksheets so I need it
to be more dynamic in the sense that it doesnt reference '07-Dec-06'
but something along the lines of

Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-14]+'Sheets(ActiveSheet.Index -
1)'!RC"
Range("Q7").Select

Or some way of selecting the previous worksheet then the one I am on
and doing a calculation in a cell.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Adding a Value from one worksheet to another.

How about this:

Range("Q6").FormulaR1C1 _
= "=RC[-14]+'" & Worksheets(ActiveSheet.Index - 1).Name & "'!RC"



newguy wrote:

That gets the formula in the cell now everytime I run it, it asks me to
save the file.

Bob Phillips wrote:
Maybe this

Range("Q6").FormulaR1C1 = "=RC[-14]+'Sheets(" & _
Worksheets(ActiveSheet.Index - 1).Name & ")'!RC"
Range("Q7").Select


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"newguy" wrote in message
oups.com...
I have tried making sense of the code from the Macro when I recorded it
but it isnt working for me.

Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-14]+'07-Dec-06'!RC"
Range("Q7").Select

This works but I need to apply it to multiple worksheets so I need it
to be more dynamic in the sense that it doesnt reference '07-Dec-06'
but something along the lines of

Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-14]+'Sheets(ActiveSheet.Index -
1)'!RC"
Range("Q7").Select

Or some way of selecting the previous worksheet then the one I am on
and doing a calculation in a cell.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Adding a Value from one worksheet to another.

That worked that you

Dave Peterson wrote:
How about this:

Range("Q6").FormulaR1C1 _
= "=RC[-14]+'" & Worksheets(ActiveSheet.Index - 1).Name & "'!RC"



newguy wrote:

That gets the formula in the cell now everytime I run it, it asks me to
save the file.

Bob Phillips wrote:
Maybe this

Range("Q6").FormulaR1C1 = "=RC[-14]+'Sheets(" & _
Worksheets(ActiveSheet.Index - 1).Name & ")'!RC"
Range("Q7").Select


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"newguy" wrote in message
oups.com...
I have tried making sense of the code from the Macro when I recorded it
but it isnt working for me.

Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-14]+'07-Dec-06'!RC"
Range("Q7").Select

This works but I need to apply it to multiple worksheets so I need it
to be more dynamic in the sense that it doesnt reference '07-Dec-06'
but something along the lines of

Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-14]+'Sheets(ActiveSheet.Index -
1)'!RC"
Range("Q7").Select

Or some way of selecting the previous worksheet then the one I am on
and doing a calculation in a cell.


--

Dave Peterson


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
adding several worksheet cells onto a main worksheet oxicottin Excel Worksheet Functions 2 September 20th 06 08:07 PM
Adding worksheet tab names to the first worksheet adam Excel Discussion (Misc queries) 1 May 17th 06 02:07 AM
list worksheet macros/VBA without adding worksheet br549 Excel Discussion (Misc queries) 0 January 6th 06 10:17 PM
Activate Previous worksheet after adding a new worksheet [email protected] Excel Programming 3 October 19th 05 01:01 AM
XL VBA adding new worksheet if current worksheet is not empty Lance Hoffmeyer Excel Programming 4 August 27th 04 07:15 AM


All times are GMT +1. The time now is 12:33 AM.

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

About Us

"It's about Microsoft Excel"