using VBA to show comments of a cell, where comments are active Bloomberg formulae

cmr72

New Member
Joined
Feb 19, 2013
Messages
43
I am trying to create a 'comment' in excel that will show Bloomberg BDP info of whatever cell is highlighted. For example, let's say active.cell = IBM and I 'hover' over IBM. I would want a comment box to pop up showing relevant market data.

<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;">
PHP:
$bid = "=BDP(active.cell &" US EQUITY","BID_ALL_SESSION")"
$bidsize = "=BDP(active.cell &" US EQUITY","BID_SIZE_ALL_SESSIONS_RT")"
$ask = "=BDP(active.cell &" US EQUITY","ASK_ALL_SESSION")"
$asksize = "=BDP(active.cell &" US EQUITY","ASK_SIZE_ALL_SESSIONS_RT")"
$last = "=BDP(active.cell &" US EQUITY","LAST_ALL_SESSIONS")"
$lastsize = "=BDP(active.cell &" US EQUITY","TRADE_SIZE_ALL_SESSION_RT")"

in 'blah' I would want ($bidsize $bid $ask $asksize $last $lastsize)

I started peeking around and found something below, but do not know how to implement. Any ideas?

<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;">
PHP:
Sub add-comments()
Dim rcell As Range
For Each rcell In Range("B2:B48")
If rcell.Value <> "" Then
rcell.AddCommentrcell.Comment.Text 'blah'
End If
Next
End Sub
</code></code>
Thanks for viewing
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,214,987
Messages
6,122,613
Members
449,090
Latest member
vivek chauhan

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