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

hello to all

I have a code line...
ActiveCell.Formula = "=COUNT(P5:P15)"

But the rowOffset won't always be 10. I've defined a rowOffset, called
RowOff, but I can't get the syntax to work with the COUNT function?
Something like ...

ActiveCell.Formula = "=COUNT(P5:P ***RowOff goes in here somehow*** )"


thanks
Dorre






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default syntax problem

try
ActiveCell.Formula = "=COUNT(P5:P" & RowOff & ")"

--


Gary


"dorre" wrote in message
...
hello to all

I have a code line...
ActiveCell.Formula = "=COUNT(P5:P15)"

But the rowOffset won't always be 10. I've defined a rowOffset, called
RowOff, but I can't get the syntax to work with the COUNT function? Something
like ...

ActiveCell.Formula = "=COUNT(P5:P ***RowOff goes in here somehow*** )"


thanks
Dorre








  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default syntax problem

Close, but this evaluates to: ActiveCell.Formula = "=COUNT(P5:P10)"

I need to understand the syntax in adding an offset (rowOff) of, say 10, to
P5, resulting in an expression equivalent to: ActiveCell.Formula =
"=COUNT(P5:P15)"

Thanks. Dorre

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
try
ActiveCell.Formula = "=COUNT(P5:P" & RowOff & ")"

--


Gary


"dorre" wrote in message
...
hello to all

I have a code line...
ActiveCell.Formula = "=COUNT(P5:P15)"

But the rowOffset won't always be 10. I've defined a rowOffset, called
RowOff, but I can't get the syntax to work with the COUNT function?
Something like ...

ActiveCell.Formula = "=COUNT(P5:P ***RowOff goes in here
mehow*** )"


thanks
Dorre










  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default syntax problem

in this example, i just set RowOff to 10 for testing, is this what you want?

this will count p5:p20
Sub test()
RowOff = 10
ActiveCell.Formula = "=COUNT(P5:P" & 10 + RowOff & ")"
End Sub

--


Gary


"dorre" wrote in message
...
Close, but this evaluates to: ActiveCell.Formula = "=COUNT(P5:P10)"

I need to understand the syntax in adding an offset (rowOff) of, say 10, to
P5, resulting in an expression equivalent to: ActiveCell.Formula =
"=COUNT(P5:P15)"

Thanks. Dorre

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
try
ActiveCell.Formula = "=COUNT(P5:P" & RowOff & ")"

--


Gary


"dorre" wrote in message
...
hello to all

I have a code line...
ActiveCell.Formula = "=COUNT(P5:P15)"

But the rowOffset won't always be 10. I've defined a rowOffset, called
RowOff, but I can't get the syntax to work with the COUNT function?
Something like ...

ActiveCell.Formula = "=COUNT(P5:P ***RowOff goes in here mehow*** )"


thanks
Dorre












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
Problem with Syntax? MurrayBarn Excel Worksheet Functions 8 June 12th 09 01:45 PM
Syntax problem unknowndevice[_4_] Excel Programming 4 August 26th 05 10:57 PM
Syntax problem Alex H Excel Worksheet Functions 1 July 2nd 05 08:23 AM
Another Syntax Problem Sharlene England Excel Programming 2 December 2nd 03 10:04 PM


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