Good Afternoon,
Please pardon the detail of this post but from the content I have read to date, a lack of clarity seems to just **** everyone off and lead to response aversion or time costly responder sub questions.
The following two questions reference the attached COL_OPT spreadsheet and GET_COL macro. I have written a macro that takes data on Swap agreements between specific broker and client combinations, filters collateral that is eligible for each unique combination, and then returns the most optimal choice of instrument to post in morning mark to market operations. The output produces two results, one that is restricted to the data in cells I:H and one that looks at all assets, shown in cells B:G. I have provided dummy data within the sheet for clarity of process. The columns listed are defined as such:
CALL - Mark to market necessary value that must be posted
PORT - Portfolio that the collateral is currently in
CUSIP - CUSIP of the instrument
HCADM - Market value of the instrument after a liquidity adjustment is made per the ISDA master agreement signed
MAT - Maturity of instrument
PAR - Par value available of the instrument
PLEASE NOTE - Per this particular dummy set of data, dont change PNCSWP and 3M i have not calibrated the dummy data to work for any other sets yet, it would take to long. If the user changes cell E124 and F 124 in DATA_CS then the output of the Macro will show the output that justifies the additional loops you see in the macro.
The macro functions properly but I have one coding technique question that I want to understand for more efficient programming technique in the future. Finally I have a question regarding automating the macro to cycle through a list of values and feed all output to a final report sheet. I thank you in advance for your kind advice. Additionally I would appreciate any comment on how I have written this in general as I am new to VBA.
Questions:
1- In the attached sheet and macro GET_COL I have a few instances where the range I need to select for a particular filtering operation is variable, based on a choice selected in a drop down list. In every other instance in my code I was able to prevent any sheet selecting or activation however in the section marked " TWO VARIABLE COLUMN REF" and in the subsequent series of Do While loops I have only had success in operating the macro through selecting or activating cells. It is not essential that I have the macro perform without this feature but I want to know how I can perform these actions without activating or selecting the cells.
2- I want to loop the macro to repeatedly execute through a list of potential CLIENT/BROKERS that I have set in cell R25. I then want to transfer only non empty output resultant from each macro run, fed into cells A3:O19, to be pushed to a final tear away sheet that presents all in one clean list.
I truly appreciate input on how I can most efficiently complete the aforementioned processes.
I will attach the code in a separate post connect to this.
email me at [email protected] and I will send the spreadsheet. It can't get smaller than 1.47mb and that exceeds the limits for attaching it here
Sincerely,
Daniel
Bookmarks