• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

new to excel and vbscript - need help

T

thewhizkid

#1
I am familiar with MS EXcel but I dont know VBscript, so please help.

I have a XL sheet with data in three columns - A,B and C.

I want to find the biggest two out of A,B,C and then average the two.

How should my VBscript look like ?


Thanks

Ravindra
 

My Computer

P

Pegasus \(MVP\)

#2
"thewhizkid" <rsdivekar@xxxxxx> wrote in message
news:ba6ad564-85c2-47c3-9587-c5623379a426@xxxxxx

>I am familiar with MS EXcel but I dont know VBscript, so please help.
>
> I have a XL sheet with data in three columns - A,B and C.
>
> I want to find the biggest two out of A,B,C and then average the two.
>
> How should my VBscript look like ?
>
>
> Thanks
>
> Ravindra
Wouldn't it be simpler to do this with a macro in Excel?
 

My Computer

T

Tom Lavedas

#3
On May 29, 7:34 am, "Pegasus \(MVP\)" <I....@xxxxxx> wrote:

> "thewhizkid" <rsdive...@xxxxxx> wrote in message
>
> news:ba6ad564-85c2-47c3-9587-c5623379a426@xxxxxx
>

> >I am familiar with MS EXcel but I dont know VBscript, so please help.
>

> > I have a XL sheet with data in three columns - A,B and C.
>

> > I want to find the biggest two out of A,B,C and then average the two.
>

> > How should my VBscript look like ?
>

> > Thanks
>

> > Ravindra
>
> Wouldn't it be simpler to do this with a macro in Excel?
You're right, there is no stated requirement that suggests a VBS
implementation. In fact, looking at the stated problem, it would seem
to me that there isn't even a need for a VBA macro. This worksheet
formula in column D solves the problem ...

=(SUM(A1:C1)-MIN(A1:C1))/2

That is, unless there is something else that wasn't said in the
original post.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
 

My Computer

T

thewhizkid

#4
On May 29, 8:30 pm, Tom Lavedas <tglba...@xxxxxx> wrote:

> On May 29, 7:34 am, "Pegasus \(MVP\)" <I....@xxxxxx> wrote:
>
>
>
>
>

> > "thewhizkid" <rsdive...@xxxxxx> wrote in message
>

> >news:ba6ad564-85c2-47c3-9587-c5623379a426@xxxxxx
>

> > >I am familiar with MS EXcel but I dont know VBscript, so please help.
>

> > > I have a XL sheet with data in three columns - A,B and C.
>

> > > I want to find the biggest two out of A,B,C and then average the two.
>

> > > How should my VBscript look like ?
> > >

> > Wouldn't it be simpler to do this with a macro in Excel?
>
> You're right, there is no stated requirement that suggests a VBS
> implementation.  In fact, looking at the stated problem, it would seem
> to me that there isn't even a need for a VBA macro.  This worksheet
> formula in column D solves the problem ...
>
> =(SUM(A1:C1)-MIN(A1:C1))/2
>
> That is, unless there is something else that wasn't said in the
> original post.
>
> Tom Lavedas
> ===========http://members.cox.net/tglbatch/wsh/- Hide quoted text -
>
> - Show quoted text -
Thanks a lot..
The solution was simpler than I thought.
Appreciate ur help.
Ravi
 

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)