Skip to content

Instantly share code, notes, and snippets.

@bbdaniels
Created November 13, 2018 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbdaniels/d5f94b2c81f6656cd645d824ce75f5b6 to your computer and use it in GitHub Desktop.
Save bbdaniels/d5f94b2c81f6656cd645d824ce75f5b6 to your computer and use it in GitHub Desktop.
Does something
// Write values
forvalues i = 2/`nRows' {
forvalues j = 2/`nCols' {
// Get the placement
local theCol : word `j' of `c(ALPHA)'
local theRow = `i'
// Get the values
local nStars = `anything'_STARS[`=`i'-1',`=`j'-1']
local nStars = min(3,`nStars')
local theValue = `anything'[`=`i'-1',`=`j'-1']
// Set the formatting
local theFormat = `format'*"0" + `nStars'*"\*" + `=3-`nStars''*"_*"
qui cap putexcel `theCol'`theRow' = `theValue' , nformat(#.`theFormat')
putexcel close
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment