I have created an array in VB code below:
Sub tempMD()
Dim ClientDNBuy(30)
Dim nCount As Integer
For Each MDClient In Range("Clients")
MDColumnOffset = Application.WorksheetFunction.Match(MDClient, Range("BlotterClients"), 0)
MDBuy = Range("Market_Price_Anchor").Offset(MDRowOffset + 1, MDColumnOffset - 1)
MDStockRef = Range("Market_Price_Anchor").Offset(MDRowOffset + 1, MDColumnOffset + 1)
MDDelta = Range("Market_Price_Anchor").Offset(MDRowOffset + 1, MDColumnOffset + 2)
MDSwapRef = Range("Market_Price_Anchor").Offset(MDRowOffset + 1, MDColumnOffset + 3)
MDOR = Range("Market_Price_Anchor").Offset(MDRowOffset + 1, MDColumnOffset + 4)
MDEquityDN = ((TouchStock - MDStockRef) * MDConvRatio / MDParValue * MDParQuote * MDDelta)
MDBondDN = (MDLiveSwap - MDSwapRef) * MDRhoPhi * 100
ClientDNBuy(nCount) = Array(MDClient, MDBuy + MDEquityDN + MDBondDN)
nCount = nCount + 1
Next
End Sub
This creates an array 30 rows X 2 columns with client name next to a value. Is it possible to sort this array as if it were a range in the spreadsheet, without pasting it into the spreadsheet and sorting!
Joel