Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Worksheet functions in VB

I use a worksheet function in VB and specificly the sum
if. This is working properly but only for one cell what
is the easy way to do for a lot of cells.

Set Myrange = Sheet2.Range("a10:a100")
Sheet1.Range("f10") = _
Application.WorksheetFunction.SumIf((Myrange) _
, Sheet1.Range("b10"), Sheet2.Range("C10:C100"))
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Worksheet functions in VB

A few more details would help. Surely you don't want every cell to have
this result?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Costas" wrote in message
...
I use a worksheet function in VB and specificly the sum
if. This is working properly but only for one cell what
is the easy way to do for a lot of cells.

Set Myrange = Sheet2.Range("a10:a100")
Sheet1.Range("f10") = _
Application.WorksheetFunction.SumIf((Myrange) _
, Sheet1.Range("b10"), Sheet2.Range("C10:C100"))



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Worksheet functions in VB

I have two sheets in the first sheet in the column A
contains accounts name and in the column B figures.
The second sheet contain the same thinks but is updated
from the first sheet. The sumIf Function in VB as I
mentioned below is working just for one cell. My question
is if it is possible to apply the same function to the
rest cell but of course the result will be different and
spread to the remainder cells.

-----Original Message-----
A few more details would help. Surely you don't want

every cell to have
this result?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Costas" wrote in

message
...
I use a worksheet function in VB and specificly the sum
if. This is working properly but only for one cell what
is the easy way to do for a lot of cells.

Set Myrange = Sheet2.Range("a10:a100")
Sheet1.Range("f10") = _
Application.WorksheetFunction.SumIf((Myrange) _
, Sheet1.Range("b10"), Sheet2.Range("C10:C100"))



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Worksheet functions in VB


Set Myrange = Sheet2.Range("a10:a100")
for each cell in Sheet1.Range("B10:B100")
Sheet1.cells(cell.row,"F").Value = _
Application.WorksheetFunction.SumIf(Myrange, _
cell.Value, Sheet2.Range("C10:C100"))
Next

--
Regards,
Tom Ogilvy



"Costas" wrote in message
...
I have two sheets in the first sheet in the column A
contains accounts name and in the column B figures.
The second sheet contain the same thinks but is updated
from the first sheet. The sumIf Function in VB as I
mentioned below is working just for one cell. My question
is if it is possible to apply the same function to the
rest cell but of course the result will be different and
spread to the remainder cells.

-----Original Message-----
A few more details would help. Surely you don't want

every cell to have
this result?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Costas" wrote in

message
...
I use a worksheet function in VB and specificly the sum
if. This is working properly but only for one cell what
is the easy way to do for a lot of cells.

Set Myrange = Sheet2.Range("a10:a100")
Sheet1.Range("f10") = _
Application.WorksheetFunction.SumIf((Myrange) _
, Sheet1.Range("b10"), Sheet2.Range("C10:C100"))



.



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
Help with worksheet functions Angeline Excel Discussion (Misc queries) 2 October 11th 06 11:19 PM
Worksheet functions Joe D. Excel Worksheet Functions 0 March 8th 06 02:24 PM
Worksheet functions Nadji New Users to Excel 2 June 10th 05 06:25 PM
worksheet functions Nadji Excel Worksheet Functions 1 June 10th 05 05:25 PM
help with worksheet functions ksnapp[_40_] Excel Programming 3 April 5th 04 10:48 PM


All times are GMT +1. The time now is 03:03 PM.

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"