Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default activecell.formular1c1

hi...

i have to get something like this ='Sum Jun''04'!C30+'Sum
Jul''04'!C30+'Sum Aug''04'!C30+'Sum Sep''04'!C30

in a cell..which i will do a copy paste thing in some 5
rows and 12 columns. fi i record hte macro i get :
ActiveCell.FormulaR1C1 = _
"='Sum Jun''04'!R[25]C+'Sum Jul''04'!R[25]C+'Sum
Aug''04'!R[25]C+'Sum Sep''04'!R[25]C"
Range("C5").Select
Selection.Copy
Range("C5:C11").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Range("C5:O11").Select
ActiveSheet.Paste
I have converted the above with the below code.It runs
perfectly fine if replace the "R[25]C" in the
activecell.formular1c1; i want it to be replaced by cells
(row,column).address(0,0) so that i can do copy paste. I
dont want to hardcode R[25]C...can anyone suggest me hte
way.,

I hope i am clear
thanks a lot

varComb = ""
For ig = 1 To totSumSheets 'repeat as
many sheets are there
st = 1
ext22 = ""
For kl = 1 To Len(trapSumShtName(ig))
ext11 = Mid(trapSumShtName(ig), st, 1)
ext22 = ext22 & ext11
If ext11 = "'" Then ext22 = ext22 & "'"
st = st + 1
Next kl
varComb = varComb & "'" & ext22 & "'!" & "R" & uuRow +
1 & "C" & 3
If Not ig = totSumSheets Then varComb = varComb & "+"
Next ig

Range(Cells(5, 3).Address(0, 0)).Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=" & varComb
Range(Cells(5, 3).Address(0, 0)).Select
Selection.Copy
Range(Cells(5, 3).Address(0, 0) & ":" & Cells(5 + nm2,
3).Address(0, 0)).Select
ActiveSheet.Paste
Range(Cells(5, 3).Address(0, 0) & ":" & Cells(5 + nm2,
3).Address(0, 0)).Select
Application.CutCopyMode = False
Selection.Copy
Range(Cells(5, 3).Address(0, 0) & ":" & Cells(5 + nm2, 3 +
nm).Address(0, 0)).Select
ActiveSheet.Paste
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
ActiveCell.FormulaR1C1 Rick Excel Discussion (Misc queries) 3 March 28th 10 10:36 PM
ActiveCell.FormulaR1C1 = "=SUM(R[-tellerteller]C:R[-1]C)" Jack Sons Excel Discussion (Misc queries) 5 September 29th 09 09:58 PM
Activecell.FormulaR1C1 Versus ActiveSheet.cells(column, row) Ashish Shridharan Excel Programming 2 February 15th 04 04:46 PM
Whats wrong with this VBA statement -ActiveCell.FormulaR1C1...? hal Excel Programming 5 November 8th 03 02:48 AM
ActiveCell.FormulaR1C1 Leif Rasmussen Excel Programming 1 October 16th 03 09:46 AM


All times are GMT +1. The time now is 05:37 AM.

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"