# new to excel and vbscript - need help

1. ## new to excel and vbscript - need 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 System Specs

2. ## Re: new to excel and vbscript - need help

"thewhizkid" <rsdivekar@xxxxxx> wrote in message

>
> 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 System Specs

3. ## Re: new to excel and vbscript - need help

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

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

>

> > 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 System Specs

4. ## Re: new to excel and vbscript - need help

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
>

>

>

> > > 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/- Hide quoted text -
>
> - Show quoted text -
Thanks a lot..
The solution was simpler than I thought.
Appreciate ur help.
Ravi
My System Specs

new to excel and vbscript - need help

 Similar Threads Thread Forum From Excel VBA to vbScriptHow would I convert this macro to vbScript? Sub Macro1() ' ' Macro1 Macro ' Range("AQ157").Select Selection.End(xlDown).Select... VB Script vbscript start excel run macro not workingI am trying to run a vbscript that opens excel then executes a macro. I have code that works but I get an error saying "The macro "sort" can not be... VB Script Re: How to copy large data from one excel to another using VBScripthttp://www.4guysfromrolla.com/webtech/010401-1.shtml Thanks to advice above, I have rewritten a few scripts to read a data file to an array first,... VB Script Vbscript unable to trap error into excelHi Guys, I am trying to grab some information about a list of servers into excel files, which works fine. What i am unable to do is trap the... VB Script Exporting MsSQL table to Excel using vbScript?Hi, I wrote a vbscript application that connects to a remote MsSql database via ODBC. I can connect, query the db and fetch records without any... VB Script Vbscript to Search ExcelHi, I am trying to write a Vbscript which will search for some keywords in all the worksheets of a excel file and if a match is found then the... VB Script VBscript applying borders in ExcelHello, Can anyone tell me how to apply borders to a range of cells in excel sheet. Any soultions will be highly appreciated. Regards... VB Script