Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to calculate this on all rows?

Today I discovered the global scripting possibilities in Excel.
Until now, in cell I2, I calculated the average of 3 values like this:

=GEMIDDELDE(F2:G2:H2)

'Gemiddelde' means 'average' in Dutch (I use a Dutch Excel).

I'd like to make the sheet do this on all rows. Any ideas?
It shouldn't be too hard I guess, but I'm not a VB programmer.

Thanks,

Albert


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default How to calculate this on all rows?

Hi Albert,

two possibilities: if you just want to do it once, you
could drag and drop it to the rows.... just click at the
bottom border of the cell I2 and drop down while you are
clicking until you reach the cell you want to end...

another possibility would be in VBA, if you need it more
often:

Sub dropdown()

For i = 1 To 35562

Range("I" & i).Formula = "=Gemiddelde(F" & i & ":g" & i
& ":h" & i & ")"
Next i

End Sub

Best

Markus

PS: gemiddelde and Mittelwert somehow correspond ;o)



-----Original Message-----
Today I discovered the global scripting possibilities in

Excel.
Until now, in cell I2, I calculated the average of 3

values like this:

=GEMIDDELDE(F2:G2:H2)

'Gemiddelde' means 'average' in Dutch (I use a Dutch

Excel).

I'd like to make the sheet do this on all rows. Any ideas?
It shouldn't be too hard I guess, but I'm not a VB

programmer.

Thanks,

Albert


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to calculate this on all rows?

or even

i = 35562
With Range("E2")
.Formula = "=GEMIDDELDE(F2:H2)"
.AutoFill Destination:=Range("E2:E" & i), Type:=xlFillDefault
End With


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Markus Scheible" wrote in message
...
Hi Albert,

two possibilities: if you just want to do it once, you
could drag and drop it to the rows.... just click at the
bottom border of the cell I2 and drop down while you are
clicking until you reach the cell you want to end...

another possibility would be in VBA, if you need it more
often:

Sub dropdown()

For i = 1 To 35562

Range("I" & i).Formula = "=Gemiddelde(F" & i & ":g" & i
& ":h" & i & ")"
Next i

End Sub

Best

Markus

PS: gemiddelde and Mittelwert somehow correspond ;o)



-----Original Message-----
Today I discovered the global scripting possibilities in

Excel.
Until now, in cell I2, I calculated the average of 3

values like this:

=GEMIDDELDE(F2:G2:H2)

'Gemiddelde' means 'average' in Dutch (I use a Dutch

Excel).

I'd like to make the sheet do this on all rows. Any ideas?
It shouldn't be too hard I guess, but I'm not a VB

programmer.

Thanks,

Albert


.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default How to calculate this on all rows?


Chapeau Bob ;o)


-----Original Message-----
or even

i = 35562
With Range("E2")
.Formula = "=GEMIDDELDE(F2:H2)"
.AutoFill Destination:=Range("E2:E" & i),

Type:=xlFillDefault
End With



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to calculate this on all rows?

i = 35562
With Range("E2")
.Formula = "=GEMIDDELDE(F2:H2)"
.AutoFill Destination:=Range("E2:E" & i), Type:=xlFillDefault
End With


Sub dropdown()
For i = 1 To 35562
Range("I" & i).Formula = "=Gemiddelde(F" & i & ":g" & i
& ":h" & i & ")"
Next i
End Sub


Thanks guys, this is excellent!

Albert




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to calculate this on all rows?

Albert,

Something I forgot to mention.

Apparently, when creating cell formulae using VBA, you should enter the
formula in English, with US English separators (such as a comma rather than
a semi-colon), and let Excel convert it to the local form. So in your
example, it seems that you should use

.Formula = "=AVERAGE(F2:H2)"

I would be interested in your experience.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Albert" wrote in message
...
i = 35562
With Range("E2")
.Formula = "=GEMIDDELDE(F2:H2)"
.AutoFill Destination:=Range("E2:E" & i), Type:=xlFillDefault
End With


Sub dropdown()
For i = 1 To 35562
Range("I" & i).Formula = "=Gemiddelde(F" & i & ":g" & i
& ":h" & i & ")"
Next i
End Sub


Thanks guys, this is excellent!

Albert




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to calculate this on all rows?

Hi Bob,

You're right about that, I had to change the formula to =Average.
I kinda expected this error, because formula's in cells are called
"formule's" in
my Dutch version. But in VB its Formula, like in the code you gave me.

So everything else in cells is different too. Like IF is ALS. I think it was
a big
mistake to translate it for cells and not for VB (and I mean: it shouldn't
have
been translated at all). This is very confusing.

If you need to know anything else, let me know!

Albert


"Bob Phillips" schreef in bericht
...
Albert,

Something I forgot to mention.

Apparently, when creating cell formulae using VBA, you should enter the
formula in English, with US English separators (such as a comma rather
than
a semi-colon), and let Excel convert it to the local form. So in your
example, it seems that you should use

.Formula = "=AVERAGE(F2:H2)"

I would be interested in your experience.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Albert" wrote in message
...
i = 35562
With Range("E2")
.Formula = "=GEMIDDELDE(F2:H2)"
.AutoFill Destination:=Range("E2:E" & i), Type:=xlFillDefault
End With


Sub dropdown()
For i = 1 To 35562
Range("I" & i).Formula = "=Gemiddelde(F" & i & ":g" & i
& ":h" & i & ")"
Next i
End Sub


Thanks guys, this is excellent!

Albert






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to calculate this on all rows?


"Markus Scheible" wrote in message
...

PS: gemiddelde and Mittelwert somehow correspond ;o)


Markus,

After adding a reply to Albert, it brought me back to this statement. As I
recall MITTELWERT is the German AVERAGE function, so could you clarify for
my understanding what you meant by this statement?

Many Thanks

Bob


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default How to calculate this on all rows?

Hi Bob,

this was just my note that the Dutch and the German
language sometimes have very close wording - and because
Albert seems to be from the Netherlands and I am from
Germany I thought about it ;o)

Sorry to confuse you...

Best

Markus



-----Original Message-----

"Markus Scheible"

wrote in message
...

PS: gemiddelde and Mittelwert somehow correspond ;o)


Markus,

After adding a reply to Albert, it brought me back to

this statement. As I
recall MITTELWERT is the German AVERAGE function, so

could you clarify for
my understanding what you meant by this statement?

Many Thanks

Bob


.

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to calculate this on all rows?

Hi Markus,

It wasn't confusion, I just thought that maybe there was something else here
I didn't know about ;-)

Thanks anyway

Bob


"Markus Scheible" wrote in message
...
Hi Bob,

this was just my note that the Dutch and the German
language sometimes have very close wording - and because
Albert seems to be from the Netherlands and I am from
Germany I thought about it ;o)

Sorry to confuse you...

Best

Markus



-----Original Message-----

"Markus Scheible"

wrote in message
...

PS: gemiddelde and Mittelwert somehow correspond ;o)


Markus,

After adding a reply to Albert, it brought me back to

this statement. As I
recall MITTELWERT is the German AVERAGE function, so

could you clarify for
my understanding what you meant by this statement?

Many Thanks

Bob


.





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default How to calculate this on all rows?

Hi Bob,

did you really bought that? It seems to me that you nearly
know everything about XL... btw: why aren't you MVP yet?

Best

Markus



-----Original Message-----
Hi Markus,

It wasn't confusion, I just thought that maybe there was

something else here
I didn't know about ;-)

Thanks anyway

Bob


"Markus Scheible"

wrote in message
...
Hi Bob,

this was just my note that the Dutch and the German
language sometimes have very close wording - and because
Albert seems to be from the Netherlands and I am from
Germany I thought about it ;o)

Sorry to confuse you...

Best

Markus



-----Original Message-----

"Markus Scheible"

wrote in message
...

PS: gemiddelde and Mittelwert somehow correspond ;o)

Markus,

After adding a reply to Albert, it brought me back to

this statement. As I
recall MITTELWERT is the German AVERAGE function, so

could you clarify for
my understanding what you meant by this statement?

Many Thanks

Bob


.



.

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
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
always calculate last 5 rows even after 1 inserted Picman Excel Worksheet Functions 9 November 11th 08 06:27 PM
How to calculate an average from various rows??? paulk2002 Excel Worksheet Functions 3 July 7th 08 10:00 AM
How to calculate avg from various rows paulk2002 Excel Worksheet Functions 3 July 7th 08 04:18 AM
How to calculate the sum of the alternate rows? Sathish Excel Worksheet Functions 2 June 22nd 06 07:49 AM


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

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"