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

Some help, please:

ActiveCell.Offset(0, 1).Formula = _
"=Sum(G4: ...........G.?....)"

where G? can be defined as the cell:
ActiveCell.Offset(-2, 1)

As I get older, I forget even the simplest of things!

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Syntax question

ActiveCell.Offset(0, 1).Formula = _
"=Sum($G$4:" & ActiveCell.Offset(-2, 1).Address & ")"

--
HTH,
Dianne

In ,
Stuart typed:
Some help, please:

ActiveCell.Offset(0, 1).Formula = _
"=Sum(G4: ...........G.?....)"

where G? can be defined as the cell:
ActiveCell.Offset(-2, 1)

As I get older, I forget even the simplest of things!

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Syntax question

Some help, please:

ActiveCell.Offset(0, 1).Formula = _
"=Sum(G4:G" & ActiveCell.Offset(-2,1) & ")"

if you want it hard coded. If you want your formula to dynamically refer to
this cell

"=Sum(Indirect(""G4:G"" & " & ActiveCell.Offset(-2,1).Address(0,0) & "))"


? "=Sum(Indirect(""G4:G"" & " & ActiveCell.Offset(-2,1).Address(0,0) &
"))"
=Sum(Indirect("G4:G" & E97))

so if E97 contained 100 then the sum would sum G4:G100


--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
Some help, please:

ActiveCell.Offset(0, 1).Formula = _
"=Sum(G4: ...........G.?....)"

where G? can be defined as the cell:
ActiveCell.Offset(-2, 1)

As I get older, I forget even the simplest of things!

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Syntax question

Many thanks to you both.

Forgot the need for 'Address'

Regards.

"Dianne" wrote in message
...
ActiveCell.Offset(0, 1).Formula = _
"=Sum($G$4:" & ActiveCell.Offset(-2, 1).Address & ")"

--
HTH,
Dianne

In ,
Stuart typed:
Some help, please:

ActiveCell.Offset(0, 1).Formula = _
"=Sum(G4: ...........G.?....)"

where G? can be defined as the cell:
ActiveCell.Offset(-2, 1)

As I get older, I forget even the simplest of things!

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003


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
Syntax question BigDave63 Excel Worksheet Functions 4 February 5th 09 06:50 PM
VBA syntax question Matt Excel Discussion (Misc queries) 2 December 5th 07 03:08 PM
syntax question Giselle Excel Worksheet Functions 4 January 29th 06 01:59 AM
More on VBE syntax line question Colette Excel Programming 4 November 16th 03 05:39 PM
VBA Syntax Question? Michael168[_54_] Excel Programming 0 November 5th 03 11:02 AM


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