Vb Script Coding

zaska

Well-known Member
Joined
Oct 24, 2010
Messages
1,046
Code:
Filter = 1;


Addcolumn(O,"Open");
Addcolumn(H,"High");
Addcolumn(L,"Low");
Addcolumn(C,"Close");

[COLOR=Red]This Exploration Code Gives me the Result of Open , High , Low & Close of Different Tickers ( Stock Symbols ).[/COLOR]

Now i want the same result to be displayed in excel sheet using VB Script.


EnableScript("vbscript");
<%
 'The exchange of variables between the AFL and VB script

E =  Name ()

 'Starting Excel
 Set Excel = CreateObject("Excel.Application")
 'Set Excel in a state of readiness
 Excel.WorkBooks.Add
 Set Sheet = Excel.WorkBooks(1).WorkSheets(1)


 'Writing to an Excel cell

 Sheet.Cells(1,1) = Name
 Sheet.Cells(1,2) = "Open"
 Sheet.Cells(1,3) = "High"
 Sheet.Cells(1,4) = "Low"
Sheet.Cells(1,5) = "Close"

[COLOR=Red] 'Initiation Equity maximum - will be needed
 ' to calculate DrawDownu
 MaxE = E(0)

 'Writing of the Equity and DrawDownu to Excel
 For i = 0 to UBound(E)
     Y = i+2
     Sheet.Cells(Y,2).Value = E(i)

     If E(i) > MaxE then
        MaxE = E(i)
     End If
     Drawdown = 0 - ((MaxE - E(i))/MaxE * 100)
     Sheet.Cells(Y,3).Value = Drawdown
 Next
[/COLOR]
 '
 Sheet.Activate
 Sheet.Columns(3).Select
 Excel.Visible = 1
%>


Dear All,

Please help me with the above code..I want the Values of Open, High , Low , Close of all the symbols in excel sheet
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top