WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Round Function Error

 
   Home -> Office -> General Protection Fault Errors RSS
Next:  in use by another  
Author Message
Arvind Mane

External


Since: Sep 23, 2008
Posts: 7



(Msg. 1) Posted: Wed Sep 24, 2008 9:25 pm
Post subject: Round Function Error
Archived from groups: microsoft>public>excel>crashesgpfs (more info?)

I think Gary''s Student have not understood my question. I know that 1.85 is
correct but if you run the macro then you can understand my question. The
Value of "a" is comming 1.84. This is an Error of Round Function. Can anyone
Help me to solve this Problem?




You don't need to do anything.

The value of 1.85 is correct (at least consistent with the worksheet function)
--
Gary''s Student - gsnu200805


"Arvind Mane" wrote:

> Please see the following Macro
>
> Sub Data1()
>
> a = 1.845
> a = Round(a, 2)
>
> End Sub
>
> i am getting "a" value as 1.84 instead of 1.85.
> What should i do?
Back to top
Login to vote
ND Pard

External


Since: Mar 04, 2008
Posts: 49



(Msg. 2) Posted: Thu Sep 25, 2008 2:08 pm
Post subject: RE: Round Function Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Arvind,

If you truly want it to RoundUp, then change your procedure to:

Sub Data1()
Dim a As Double
a = 1.845
a = Application.WorksheetFunction.RoundUp(a, 2)
Debug.Print a
End Sub

Good Luck.

"Arvind Mane" wrote:

> I think Gary''s Student have not understood my question. I know that 1.85 is
> correct but if you run the macro then you can understand my question. The
> Value of "a" is comming 1.84. This is an Error of Round Function. Can anyone
> Help me to solve this Problem?
>
>
>
>
> You don't need to do anything.
>
> The value of 1.85 is correct (at least consistent with the worksheet function)
> --
> Gary''s Student - gsnu200805
>
>
> "Arvind Mane" wrote:
>
> > Please see the following Macro
> >
> > Sub Data1()
> >
> > a = 1.845
> > a = Round(a, 2)
> >
> > End Sub
> >
> > i am getting "a" value as 1.84 instead of 1.85.
> > What should i do?
>
Back to top
Login to vote
ND Pard

External


Since: Mar 04, 2008
Posts: 49



(Msg. 3) Posted: Thu Sep 25, 2008 2:25 pm
Post subject: RE: Round Function Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Try this:

Sub Data1()
Dim a As Double
a = 1.845
a = Application.WorksheetFunction.RoundUp(a, 2)
Debug.Print a
End Sub

Good Luck

"Arvind Mane" wrote:

> I think Gary''s Student have not understood my question. I know that 1.85 is
> correct but if you run the macro then you can understand my question. The
> Value of "a" is comming 1.84. This is an Error of Round Function. Can anyone
> Help me to solve this Problem?
>
>
>
>
> You don't need to do anything.
>
> The value of 1.85 is correct (at least consistent with the worksheet function)
> --
> Gary''s Student - gsnu200805
>
>
> "Arvind Mane" wrote:
>
> > Please see the following Macro
> >
> > Sub Data1()
> >
> > a = 1.845
> > a = Round(a, 2)
> >
> > End Sub
> >
> > i am getting "a" value as 1.84 instead of 1.85.
> > What should i do?
>
Back to top
Login to vote
Arvind Mane

External


Since: Sep 23, 2008
Posts: 7



(Msg. 4) Posted: Thu Sep 25, 2008 10:15 pm
Post subject: RE: Round Function Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thank you ND Pard,
its Working fine.

"ND Pard" wrote:

> Hi Arvind,
>
> If you truly want it to RoundUp, then change your procedure to:
>
> Sub Data1()
> Dim a As Double
> a = 1.845
> a = Application.WorksheetFunction.RoundUp(a, 2)
> Debug.Print a
> End Sub
>
> Good Luck.
>
> "Arvind Mane" wrote:
>
> > I think Gary''s Student have not understood my question. I know that 1.85 is
> > correct but if you run the macro then you can understand my question. The
> > Value of "a" is comming 1.84. This is an Error of Round Function. Can anyone
> > Help me to solve this Problem?
> >
> >
> >
> >
> > You don't need to do anything.
> >
> > The value of 1.85 is correct (at least consistent with the worksheet function)
> > --
> > Gary''s Student - gsnu200805
> >
> >
> > "Arvind Mane" wrote:
> >
> > > Please see the following Macro
> > >
> > > Sub Data1()
> > >
> > > a = 1.845
> > > a = Round(a, 2)
> > >
> > > End Sub
> > >
> > > i am getting "a" value as 1.84 instead of 1.85.
> > > What should i do?
> >
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> General Protection Fault Errors All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET