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 / September 2006

Tip: Looking for answers? Try searching our database.

Loop through cells and run function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
staeri@gmail.com - 30 Sep 2006 16:13 GMT
How can I loop through rows 14 to 33 and set the value in the A cell
returned by this function for each rows:

Range("A14").Value = CalculateScore(B14, C14, D14)

Regards,

S
Carim - 30 Sep 2006 16:19 GMT
Hi,

Is it what you are looking for ?

For i = 14 to 33
Range("A & i &").Value = CalculateScore(B & i, C & i, D & i)
Next i

HTH
Cheers
Carim
JMB - 30 Sep 2006 17:39 GMT
Range("A & i &") should be Range("A" & i)

Also, I think you need to know how the arguments for CalculateScore are
declared, strings or ranges? (and possibly variants - but the actual code in
CalculateScore should show how the arguments s/b passed).

If declared as a range, I think you'll need to use
For i = 14 to 33
Range("A" & i).Value = CalculateScore(Range("B" & i), Range("C" & i),
Range("D" & i))
Next i

If the arguments are declared as a string, then just
For i = 14 to 33
Range("A" & i).Value = CalculateScore("B" & i, "C" & i, "D" & i)
Next i

If the OP actually wants the formula in the cell then
For i = 14 to 33
Range("A" & i).Formula = "=CalculateScore(B" & i & ", C" & i & ", D" & i &
")"
Next i



> Hi,
>
[quoted text clipped - 7 lines]
> Cheers
> Carim
staeri@gmail.com - 30 Sep 2006 18:50 GMT
Thank's a lot!

Regards,

S

Carim skrev:

> Hi,
>
[quoted text clipped - 7 lines]
> Cheers
> Carim
 
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.