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 help with range in vba function

I have that code

public function toto(r as Range) as long
dim i as long

for i = 1 to r.count
toto = toto + r.Cells(1,i).value
if r.Cells(1,i).value < 10 then
r.Cells(1,i).select
with selection.font
.Strikethrough = True
End With
end if
next i

end function

if I'm in the execution window i can type ?toto(activesheet.range("A1:A12"))
that works fine

but if in a cell I type =toto("A1:A12") the fonction does sum the values but
the select and the strikethrough does'nt work.

thanks
Cédric


 
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 function and a range mrsatroy Excel Worksheet Functions 4 March 16th 10 05:07 PM
Range of a function Daniel Excel Discussion (Misc queries) 3 September 18th 07 08:48 AM
DBSUM function but with function as criterion, not a range corne_mo Excel Worksheet Functions 3 July 13th 07 12:20 PM
range function Felicia Excel Discussion (Misc queries) 2 January 29th 07 06:10 PM
Between/ range function sanpanico Excel Discussion (Misc queries) 3 April 28th 05 10:25 PM


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