VBA help (again)

This is a discussion on VBA help (again) within the Trading Software forums, part of the Commercial category; Just tested actually, because the default for the .Address property is the fixed style (ie "$N$1" rather then "N1") tou'll ...

Reply
 
LinkBack Thread Tools Search this Thread
Old Nov 14, 2007, 4:16pm   #25
 
A Dashing Blade's Avatar
Joined Jul 2004
Just tested

actually, because the default for the .Address property is the fixed style (ie "$N$1" rather then "N1") tou'll have to use either the syntax

If Target.Address(False, False) = "N1" Then

Elseif Target.Address(False, False) = "P1" Then

End IF


OR

If Target.Address = "$N$1" Then

Elseif Target.Address = "$P$1" Then

End IF


the choice is yours. The (False,False) parameters are obviously saying "don't give me the address property in absolute row and absolute column terms.

Note that, in the above example, your comparing two two sets of text ie the .Address property of a range (which is text) and the text "N1". What you & I call text is what IT bods call a string.
A Dashing Blade is offline   Reply With Quote
Old Nov 15, 2007, 3:16am   #26
Joined Jun 2006
grantx started this thread DB,

Please see attachment, as per instructions. Shouldn't we be specifying a target cell/range?

Grant.
Attached Files
File Type: doc DB 1.doc (25.0 KB, 129 views)
grantx is offline   Reply With Quote
Old Nov 15, 2007, 8:54am   #27
 
A Dashing Blade's Avatar
Joined Jul 2004
Er . .. yes

eg

If Target.Address = "$NS1" then
do something eg Me.Range("A1")=Target.Value will copy N1's value into A1
Else
do something else
End if
A Dashing Blade is offline   Reply With Quote
Old Nov 15, 2007, 7:28pm   #28
Joined Jun 2006
grantx started this thread DB,

It's a fair cop. Ignorance may be a defence but stupidity doesn't stand up.

Still isn't working, I'm afraid.

I don't like to burden you with all my queries so I spread them across various sites. And there is a recurring feature of most solutions - they don't work. I don't believe this is due to faults in the codes but a possible conflict with VBA code/modules from my data vendor. This is just a guess - based on either ignorance or stupidity.

For example, the the data in Excel sheet I've attached on a number of occasions has its origins from a VBA charting module here (please refer to the attachment).

The bottom chart is the focus (albeit blank). Once attached to the price (tick) chart data is downloaded into Excel. The code been expanded to include more fields, for example.

What do you reckon?

Grant.
grantx is offline   Reply With Quote
Old Nov 15, 2007, 7:31pm   #29
Joined Jun 2006
grantx started this thread Attachment
Attached Files
File Type: doc DB 3.doc (33.5 KB, 157 views)
grantx is offline   Reply With Quote
Old Nov 16, 2007, 10:08am   #30
 
A Dashing Blade's Avatar
Joined Jul 2004
So . . . to recap.

1) You get live data into your sheet when you bring in a chart.
2) We've established that when you used the Worksheet_Change event, you DID
see data changing in the status bar

As I understand it, your problem is that altho we can see data in the status bar, you can't get in onto a spreadsheet? Is this correct?

Can you describe what happens (or doesn't) ie any error messages etc?
A Dashing Blade is offline   Reply With Quote
Old Nov 23, 2007, 9:14am   #31
 
5 Posts
Joined Oct 2007
Hello Grantx.

Look for something like Dim BidSize or Dim AskSize. Under this copy and paste into your code
Dim Counterbid As Double
Dim CounterAsk As Double
Under the main block of code shown above copy and paste into your code
Counterbid = BidSize
CounterAsk = AskSize
For i = 2 To 10
If (.LimitVol(i, osBuy, 0, Data) <> NullValue) Then
Counterbid = Counterbid + .LimitVol(i, osBuy, 0, Data)
End If
If (.LimitVol(i, osSell, 0, Data) <> NullValue) Then
CounterAsk = CounterAsk + .LimitVol(i, osSell, 0, Data)
End If
Next i
ExcelDoc.Sheets(1).Cells(2, 19).Value = Counterbid
ExcelDoc.Sheets(1).Cells(2, 22).Value = CounterAsk

I hope this helps you.

Mikel.
JOSEBA is offline Software vendor   Reply With Quote
Old Nov 23, 2007, 9:30am   #32
 
Profitaker's Avatar
Joined Jan 2005
Forgot to mention this last time I swung past:-

http://www.excelforum.com/
__________________
Good judgment comes from experience. Experience comes from bad judgment.
Profitaker is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivots and VBA grantx Technical Analysis 7 Nov 1, 2007 10:40pm
VBA help needed grantx Technical Analysis 24 Oct 19, 2007 8:10pm
Excel VBA Developer job??? gurm Home Trader 5 Nov 30, 2005 10:29pm
any techies able to help Excel Vba V. III Techies Corner 3 Sep 19, 2003 9:51am

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)