LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using variable inside activeCell reference call

hey everybody

hoping someone can help with VBA syntax:

I want to use the variable x as a row number reference,

'Insert Total calculation
x = 0
Range("H1").Select
'go the end of the column
Do While IsEmpty(ActiveCell.Offset(0, 0)) = False
x = x + 1
ActiveCell.Offset(1, 0).Select
Loop

I have tried the two statements below but they seem to be illegal.

ActiveCell.FormulaR1C1
"=SUM(R[ActiveCell.Offset(0,0)]C:R[ActiveCell.Offset(-&x,0)]C)"

ActiveCell.FormulaR1C1 = "=SUM(R[-&x]C:R[-1]C)"


Any help appreciated
thank

--
Message posted from http://www.ExcelForum.com

 
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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Can I use a variable to call up another sheet in Excel? GD Cooley Excel Worksheet Functions 1 February 13th 05 05:40 AM
Call a proc inside itself (HELP) David Excel Programming 2 February 4th 04 08:28 PM
can I call a procedure using a variable Santiago Gomez Excel Programming 8 December 24th 03 09:08 PM
Using variable to call worksheets Calypsoblur Excel Programming 3 November 8th 03 10:47 PM


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