Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

syntax problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dorre - 20 Mar 2006 03:54 GMT
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
Gary Keramidas - 20 Mar 2006 04:01 GMT
try
ActiveCell.Formula = "=COUNT(P5:P" & RowOff & ")"

Signature

Gary

> hello to all
>
[quoted text clipped - 9 lines]
> thanks
> Dorre
dorre - 20 Mar 2006 17:19 GMT
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

> try
> ActiveCell.Formula = "=COUNT(P5:P" & RowOff & ")"
[quoted text clipped - 13 lines]
>> thanks
>> Dorre
Gary Keramidas - 20 Mar 2006 18:20 GMT
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

Signature

Gary

> Close, but this evaluates to:  ActiveCell.Formula = "=COUNT(P5:P10)"
>
[quoted text clipped - 20 lines]
>>> thanks
>>> Dorre
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.