We help IT Professionals succeed at work.

Code clean

Ted Penner
Ted Penner asked
on
285 Views
Last Modified: 2012-05-27
Hats off to Dave for all the assistance with this. What we have now is amazing!

I am looking to clean up the code used in the v5 workbook here a little https://www.experts-exchange.com/askQuestion.jsp?taid=604.  I would prefer to have as many one or two line descriptors to state the purpose of each major block of code as needed, and have appropriate names in the modules "if" more than one module is required. Ideally, I'd like to have only one module to reference all the code but if there are some technical reasons why this isn't possible, then that is OK. The bottom line is that I would like to be able to tell what each section of code does, a little easier than I can currently.

Note that it is also no longer necessary to remove any columns during the import function. The following columns should all be shown depending on their availability in the following two types of exports, and should not have been coded to be removed. The section of code that removes the columns, can be deleted:

Live Trading Export – Trade History Columns
Exec Time | Spread | Side | Qty | Symbol | Exp | Strike | Type | Price | Net Price | Order Type

Paper Money Export - Trade History Columns
Order ID | Exec Time | Spread | Side | Pos Effect | Qty | Symbol | Exp | Strike| Net Price | Order Type

Thank you sir!
Comment
Watch Question

Most Valuable Expert 2012
Top Expert 2012

Commented:
There aren't enough lines to require having more than one module.  However, for debugging purposes and general understanding, grouping subroutines and functions under a common, related module is a better practice than lumping all the routines in one module.

As a result, I've named the modules, after adding documentation to the code - at the top and inside the code, to ease debugging that may be required in future.

The columns you have been documented are allowed entry into the sheet, and logic has been added to select the appropriate columns in the InsertPostion based on selection code, re: checking/unchecking trades that make up a position.

See attached.

Dave
2.28-select-movable-trades-r61.xlsm
Ted PennerData Structures Engineer

Author

Commented:
Fantastic!  We missed one column and some adjustment to ease view-ability needs to be made.  Here is a video on what I noticed http://screencast.com/t/ib9wWWv3.  I am forming the column documentation now on what needs to be moved over. It should be relatively straight forward and will be posted in a subsequent question.
Most Valuable Expert 2012
Top Expert 2012
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Ted PennerData Structures Engineer

Author

Commented:
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.