(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?
(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?
>
(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?
>
(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?
> >
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