Excel Looping With Bloomberg And Pause

Apr 30, 2014

I have an excel workbook right now with a 75x75 correlation matrix. It has 75 stock prices and uses bloomberg to pull in the correlation between each of the holdings. There is a lot of data so it takes roughly 35 seconds for it all to get pulled in from bloomberg. The input value that I can change is the date. The output value is a specific correlation coefficient. Thus, if I input today's date into a cell in the file, it will run the correlation matrix and tell me the correlation between all the holdings using the past year's data. Then it will produce a single output value.

I am now looking to use VBA to make this more robust. What I have been trying to do is have a macro which will -

(1) input the current date into the input cell
(2) have the code wait 35 seconds (and since it is using bloomberg pull in the traditional wait methods do not work because they actually stop the data pull in also)
(3) copy the output value
(4) paste special that value in a different cell
(5) repeat the process but this time use the date from a day before and have the output value copied and pasted to a cell below the previous one.

This loop would continue over 20 times.

Below I have some code that allows me to do this process once but is not looped and I have been stuck trying to make this work with a loop given the bloomberg delay. When I add a loop, it does not wait the 35 seconds I need before doing the whole process again.

[Code] .....

View 2 Replies


ADVERTISEMENT

Excel VBA Pausing For Bloomberg?

Apr 30, 2014

Trying to create a macro where it will begin by inserting today's date into a cell, then pause for roughly 35 seconds while the massive correlation matrix pulls all the correlations of the portfolio in, then takes an output value that is generated in the workbook from the filled correlation matrix (correlation coefficient) and copy's and pastes it in a different cell. Then it repeats this process again using "Today's date - 1" (yesterday's date), waiting 35 seconds again and taking the new output value and copy and pasting it below the previous one.

I know I am not close but here is what I have for code thus far (which does not work properly).

[Code].....

View 4 Replies View Related

Bloomberg - Excel Function To Get Information Through ISIN Code?

Apr 15, 2014

, just by using the ISIN code of a Bond in bloomberg, to get in excel:

- Coupon
- Cpn Freq
- Day Cnt
- Maturity

View 1 Replies View Related

API Bloomberg (trying To Use BLP_DATA_CTRLLib.BlpData)

Jul 9, 2009

I have a problem with this this code trying to use BLP_DATA_CTRLLib.BlpData.

Sub MultidayHistory()

Dim objDataControl As BLP_DATA_CTRLLib.BlpData
Set objDataControl = New BlpData
Debug.Print "Formulaire Ouvert"

Dim vtResult() As Variant
Dim arrayFields As Variant
Dim vtSecurities() As Variant
Dim CalculDate As Date ' rien à voir avec cdate
Startd = Range("C10").Value
Endd = Range("C11").Value

arrayFields = Array("PX_LAST", "PX_VOLUME", "SPOT_PRICE", "CHG_NET_1D", "CHG_PCT_1D")
arraySecurities = Array("GLE FP Equity", "SX5P Index")......................

View 2 Replies View Related

Loading Data From Bloomberg

Dec 3, 2008

I hope there's someone who's familiar with Bloomberg in this forum.

My problem is, I have a template which conducts checks with data extracted a Bloomberg Terminal. I want to ensure that all data has FULLY loaded before I execute the checks.

So is there a way to detect if data is still loading?

Like for example, I need data to load from A1:A100, but data has only populated until A50. In this case I need to know that the other 50 cells are still populating.

View 9 Replies View Related

Data Retrieved From Bloomberg

Jan 5, 2009

refer to the picture:

Column H and column X contain dates. If column H = column X, "OK" will be shown. Otherwise "CHECK" would be shown.

The dates are the same, but the problem is, Excel reads column X differently from column H.

I've tried converting both columns to ddmmyyyy and then comparing them, but it doesn't work.

For i = 2 To range("A" & rows.count).end(xlup).row

If Format(Cells(i, 24), "ddmmyyyy") = Format(Cells(i, 8), "ddmmyyyy") Then
Cells(i, 36) = "OK"
Else
Cells(i, 36) = "CHECK"
End If

Next

Is there a foolproof way of doing it?

Column X is data retrieved from Bloomberg, so the format cannot be changed directly.

View 9 Replies View Related

Import Bloomberg Data

Aug 5, 2007

If it is actually not possible to change the way that bloomberg exports the information to excel then i think there might be two potential ways around it...neither of which i am sure how to do...

1) write some sort of macro which takes data from the new workbook, pastes it into the active workbook then closes the newly created workbook. Potential problem here is that whenever it creates a new workbook it has a slightly different name. eg. "abc1" then "abc2" etc.

2) Write some sort of macro which gets a list of companies from bloomberg with upcoming events over the next week, put this into the active workbook and then simply use the bloomberg get functions to fill out the info.

View 2 Replies View Related

Excel 2003 :: Do Until IsEmpty Looping

Aug 3, 2012

Excel 2003. I believe I've got everything working in the code up until:

Code:
If rnGx = rnGy Then

It loops once and then "Run-time error '424': Object Required" for the code above.

Code:
Sub test1()
Dim rnGx As Range
Dim rnGy As Range
Dim i As Long
Dim xNum As Integer
Dim yNum As Integer
i = 2
Set rnGx = Cells(i, 2)

[Code] ....

In case I'm way off, I'm trying to get the code to do the following:

Look for identical entries in column bw here duplicates exist, sum the corresponding column d values into one of the existing columns delete the remaining duplicate do this until there are no matches.

Column b is sorted ascending, so any matches should be next to each other. as I'm writing this, though - I realize that if there are triplicates or more in column B, this would need to be run more than once.

View 7 Replies View Related

How To Add A Bloomberg BDP Function To Lookup Statement

Oct 16, 2012

I need to add a Bloomberg BDP function to my lookup statement. The formula that i'm trying to replicate in VBA is =IF(ISBLANK(h23,"",BDP(H23&" cusip","long_comp_name")). update my macro.

View 9 Replies View Related

Macro To Loop Bloomberg Formula

Aug 21, 2014

i have the following macro that loops through 100 tickers in sheet 1, gets the trades for each, pushes each ticker's trades to sheet 2 to create a list of all trades. The problem is that I just get a #N/A requesting data for each ticker. This seems to be a wider problem with fetching external data from Bloomberg. However, I cannot seem to get a fix for it.

Sub Macro()
On Error Resume Next
Sheet2.Range("B3:E65536").ClearContents

[code]....

View 1 Replies View Related

Refresh All Bloomberg Data Using Macro Or VBA

Jun 24, 2014

I attempted doing this by recording the macro but the macro doesn't read me clicking onto Bloomberg Refresh Data Button. How can I do this using VBA?

View 1 Replies View Related

Macro To Force Refresh Bloomberg Data

Feb 8, 2007

I have a workbook that pulls in index data from Bloomberg, most data is updated realtime, but one index we track is only updated late at night. I want to write a macro that will refresh all of the data in the worksheet and then save a snapshot of the workbook. I have all the code for saving the snapshot, but getting the data for the one index to refresh is proving difficult. None of the standard ways I know to refresh external data (both Excel commands via tools menu, and Bloomberg specific refresh commands) seem to work on these cells. The only way so far I've found to get these cells to pull in current data is to delete them and rewrite the formulas.

suggestion for a Macro that would force a refresh of this data?

View 7 Replies View Related

Excel 2002 :: VBA Looping Copy / Paste Special For Each Row

Jan 25, 2012

Excel 2002.I have data in columns A and B on sheet 3, starting at row 100. The total number of rows of data is variable (max is 50 rows). I want to take the values in A100:B100 and copy them from Sheet3 and paste values transposed to SheetTL Range C1:C2. I have started to write the following code but as you can see I will have to repeat the code upwards of 50 times. It seems I should be able to do a COUNT function to see how many rows of data exist and then somehow loop the code to copy the data from each subsequent row that many times, but how to put that together.

Sheets("Sheet3").Range("A100:B100").Copy
Sheets("TL").Range("C1").PasteSpecial Paste:=xlPasteValues, Transpose:=True
ActiveSheet.PrintOut
If Sheets("Sheet3").Range("A101") = "" Then

[Code] .........

View 5 Replies View Related

Bloomberg BDH Refresh Via Macro Loop Application.Ontime

Dec 10, 2009

Firstly you don't need to know anything about Bloomberg to answer this query, only that Bloomberg has various functions that take time to update.

The code Application.Run "RefreshEntireWorkbook" will update these functions but Application.OnTime (Now + TimeValue("00:00:25")), "RunList" is required to allow them time to get the data from the feed. However this only works if the refresh and wait commands are in a seperate function. So in simplified terms it must go like this in vba:

View 2 Replies View Related

Looping Macro Freezes Excel When Encountering Large Numbers Of Rows

Sep 15, 2009

We are attempting to use the macro below.

We believe that the problem is "memory related."

However, we can't find the correct workaround to the issue.

In Excel 2002, the behavior was for the macro to work great on small numbers of rows, but to just stop on large numbers of rows. After it stopped, the user would manually run the macro throughout the spreadsheet, by holding down Ctrl + N.

In Excel 2007, the behavior of the program is different, and Excel actually freezes up.

We've narrowed down the problem to be possibly "memory related."

However, we don't know the correct workaround for this.

For example, in the posting below (the referenced link) they suggest using "variant arrays" to address memory limitations type of issues ... but I'm not sure of how to implement those.

View 6 Replies View Related

Excel 2007 :: Looping Through Text Strings And Copying Based On Criteria

Sep 17, 2012

I have 2 excel files, let's call them 1.xlsx and 2.xlsx (excel 2007)

File 1 is the file where I want data copied into and file 2 is the file I want to copy data from.

File 1 has certain text strings in every say 5th column in always row 2. I want to find those strings in file 2 and if the string is found, go 6 rows down, copy the cell, and paste it into file 1, 8 rows down the text string. this is the code I came up with, but it doesn't work

Code:
Option Explicit
Sub get_data_from_2()

Dim i As Long
Dim j As Long
Dim FinalColumn As Long
Dim RngFrom As Range

[Code] .......

the bolded part gives me an error.

View 3 Replies View Related

VBA Calculate Pause

Mar 16, 2009

Hi everyone I am having a little trouble with a sheet i'm currently working on. Having exhausted what i believe to be every avenue trying to do this without VBA, i've finally had to sucomb to it as i can't see an alternative and i'm no VB expert by any means! This is what i have so far:

View 7 Replies View Related

Add Pause Between Count And Boxes?

Feb 22, 2014

How can I add the pause between count & boxes?

VB:
s.Speak count & "boxes for scanning!"

View 6 Replies View Related

Pause Other Timers When Another Is Started?

Jul 31, 2014

I've a set of tasks in Column A which I would like to measure. At times, Users flip from task A to task B then back to A and so on. I would like to be able to pause a timer on task A if when timer on task B is started and same as well with the other tasks.. When Task A is started again, it should continue the timer if not add the on-going time to the presently running time under that task.

View 2 Replies View Related

Pause For 0.5 Seconds (half A Second)

Jun 3, 2009

I need to pause for 0.5 seconds (half a second). How can I do that. applicatiom.Wait can only be used for whole seconds and a FOR ... NEXT loop is CPU dependant.

View 3 Replies View Related

Pause Macro And Then Run It After 10 Minutes?

Oct 23, 2012

is there a code i can have where i can a pause a macro and then run it after 10 mins from that point?

View 5 Replies View Related

Pause Within A Loop Execution

Jun 10, 2007

I want to establish a loop in VB and within the loop I would like to pause execution of the loop and wait for input from a cell then resume execution of the loop once input has been entered.

View 9 Replies View Related

Pause Or Stop Macro

Jun 24, 2006

I am running a macro that populates the same chart with variable data. I have approximately 40 sets of data and wish to pause or stop the macro to view one of the sets of data more closely. The pause option would be better but Stop option is acceptable

View 2 Replies View Related

Pause In VBA Loop Then Restart From Where It Stopped

Jun 17, 2013

I'm looking for a simple solution to pause a VBA loop and then restart it from where it stopped.

Is it with a boolean value, i dont know the code.

View 9 Replies View Related

Pause Macro Execution Without Using Stop?

Jul 3, 2014

I have macros that often pause for the user to take some action -- for instance, to confirm that the correct cells are selected, or to delete something. Usually I use the "Stop" command, which opens the VBA editor; when I finish doing the manual action, I just resume the macro.

When writing macros for actual users, I'd like to do the same thing without their having to deal with the VBA window. Is there a way to pause and resume action and remain in the Excel window?

View 3 Replies View Related

Can Pause A Running Macro Then Restart It

Mar 19, 2014

I've written a macro for work that will work with our billing process. After part of it has run, I'd like to pause it for the user to check a column for errors and possibly update a table to get rid of those errors, then after those errors are fixed, have the ability to continue with the rest of the code. I tried to make a message box to remind the user to look for the errors, but it wouldn't allow me to click anywhere except for on the buttons.

View 4 Replies View Related

Macro Pause Then Resume By Keystroke

Nov 11, 2012

Is there a way a macro can be paused then resume running the macro by a keystroke, not a time delay.

View 3 Replies View Related

Adding Pause To Existing Macro?

Mar 21, 2013

I would like to add a pause to the following macro so that it inserts the word CANCEL 1 second after triggering. I know I need to use the Application.Ontime function but cannot work out how to integrate it.

Code:
Sub Cancel() Application.ScreenUpdating = False
Sheets("Sheet1").Range("T5") = "CANCEL"
Application.ScreenUpdating = True
End Sub

View 3 Replies View Related

Can I Pause And Then Start Recording Macro Again

Nov 17, 2006

I'm recording a Macro but I want to test certain section before I complete it, so can I pause the recording and then restart the recording again?

View 9 Replies View Related

Macro To Pause Code, Another To Resume

Jul 27, 2007

I have a workbook with several hundred row the VBA code loops through. It takes about an hour to run all the calculations. Whenever I need to pause the script I hit ESC, which works well for me, but for other users it would be nice to have a command button that halts code. Even better would be another button to resume code.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved