Tuesday, February 2, 2021

Tip -- 2.1b - Using the smfUpdateDownloadTable macro

---In smf_addin@yahoogroups.com, <rharmelink@...> wrote :

Let me restate [Tip 2.1a] and give some visuals of creating a range to fill using the smfUpdateDownloadTable macro:
  1. The upper left hand corner cell of the table needs to have a range name of "Ticker" (see green-shaded cell on diagram). The text in the cell can be anything you want it to be.
  2. The cells below the "Ticker" cell should be filled in with Yahoo ticker symbols, one per cell (see yellow-shaded cells on diagram).
  3. The cells to the right of the "Ticker" cell should be filled with column titles (see orange-shaded cells on diagram. The text in these cells can be anything you want them to be.
  4. The cells above the column titles need to be filled in with SMF add-in formulas or element numbers (see blue-shaded cells on diagram). Use five tildas as a substitute for a ticker symbol. For example, any of the following text strings could be used to get "Market Capitalization" from Yahoo:

    941
    RCHGetElementNumber("~~~~~", 941)
    RCHGetTableCell("http://finance.yahoo.com/q/ks?s=~~~~~",1,">Market Cap")

    If you place an "X" in the cell of the element definition, it would tell the smfUpdateDownloadTable macro to skip it and leave that column alone. I do this when I want to create a column with my own formulas in, or to use as a divider column in the table.
The macro continues processing rows with ticker symbols (i.e. green-shaded cell) until it runs into an empty cell with no ticker symbol in it. It continues process across the row of element definitions (i.e. blue-shaded cells) until it runs into an empty cell with no element definition in it.

So, this is what it would look like after doing the four steps above:

 941X942
Heading0Heading1Heading2Heading3
MMM   
IBM   
AA   

After running the smfUpdateDownloadTable macro, it would look like this:

 941X942
Heading0Heading1Heading2Heading3
MMM58800000 61300000
IBM1.73E+08 1.88E+08
AA15230000 23800000

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.