VBA and Round

  • Thread starter onetwoonetwoandthrough
  • Start date
O

onetwoonetwoandthrough

I just discovered the Round function is missing in the Mac version of
VBA. Is there an easy workaround, or do I have to write my own?

On an urelated note, what happened to the Microsoft interface to this
newsgroup? I looked for it, and the Mactopia site from Microsoft sent
me to Google groups. I normally access this group through nntp, but I
am away from my regular computer now.

--David
 
J

Jim Gordon MVP

Hi David,

I know ROUND as an Excel worksheet function in VBA. Are you expecting it to
be part of PowerPoint?

You can use the ROUND function from PowerPoint if Excel is installed.

I always use NNTP so I don't pay much attention to other ways of getting to
the newsgroups.

-Jim


Quoting from "(e-mail address removed)"
I just discovered the Round function is missing in the Mac version of
VBA. Is there an easy workaround, or do I have to write my own?

On an urelated note, what happened to the Microsoft interface to this
newsgroup? I looked for it, and the Mactopia site from Microsoft sent
me to Google groups. I normally access this group through nntp, but I
am away from my regular computer now.

--David

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
S

Steve Rindsberg

I just discovered the Round function is missing in the Mac version of
VBA. Is there an easy workaround, or do I have to write my own?

Well isn't THAT weird.

Something like this do ya?

Function Round(dblNumber as Double) as Integer
If dblNumber - Cint(dblNumber) > .5 Then
Round = Cint(dblNumber) + 1
Else
Round = Cint(dblNumber)
End If
End Function

On an urelated note, what happened to the Microsoft interface to this
newsgroup? I looked for it, and the Mactopia site from Microsoft sent
me to Google groups. I normally access this group through nntp, but I
am away from my regular computer now.

Good starting point:

http://www.microsoft.com/mac/community/community.aspx?pid=newsgroups

Or visit the FAQ:

The PowerPoint Newsgroup
http://www.pptfaq.com/FAQ00275.htm

================================================
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
D

David M. Marcovitz

Thanks Steve and Jim. I did something like what you suggested for Round.
I have a feeling that it has to do with different versions of VBA (5 vs.
6?) running on Mac PowerPoint and Windows PowerPoint.

As far as the link you suggest to the newsgroups, that link points to the
Google interface.

--David (back on NNTP)

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
S

Steve Rindsberg

David M. said:
Thanks Steve and Jim. I did something like what you suggested for Round.
I have a feeling that it has to do with different versions of VBA (5 vs.
6?) running on Mac PowerPoint and Windows PowerPoint.

As far as the link you suggest to the newsgroups, that link points to the
Google interface.

--David (back on NNTP)

Feels so nice when you stop hitting yourself over the head, doesn't it?

BTW, Chirag has kindly pointed out the folly of my ways.
The function I posted will work for positive numbers, within limits, for the
wrong reason.

This (courtesy of Chirag) does the deed:

Function Round(ByVal D As Double) As Long
Round = Fix(D + Sgn(D) * 0.5)
End Function


================================================
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
D

David M. Marcovitz

Feels so nice when you stop hitting yourself over the head, doesn't
it?

BTW, Chirag has kindly pointed out the folly of my ways.
The function I posted will work for positive numbers, within limits,
for the wrong reason.

This (courtesy of Chirag) does the deed:

Function Round(ByVal D As Double) As Long
Round = Fix(D + Sgn(D) * 0.5)
End Function


================================================
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================

Thanks for everyone's help. I have passed this function along to my
student who was surprised that the great project that his group completed
didn't work on his Mac because of the missing Round function.

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top