Background
The business needs to write all the corresponding pages according to the detailed design document
Problem
Heavy workload, 11 large tables (dozens of hundreds of fields) time tight 3 days to complete
Core
There is a complete table design that can be edited manually through Excel.
New issues
Normal field is not a problem, can increase the workload of the dictionary after a sudden increase, this particularity makes the work difficult and volume of the manual operation of Excel poses a challenge
Solution Solutions
Work with Excel manually by code, that is, by writing VBA macros
Sub detailpage () " foam Gold" Generate resident Health File Browser page, time: 2017/08/17 ' Dim tri as integer, td, tablename, namec, valc, dicc, savec as string ' configuration area: Config ' Three-column row controller Recorder tri = 1 ' table name Tablename = lcase (Cells (1, "D")) ' label column namec = ' A ' Value column valc = "B" ' Dictionary column dicc = "C" ' Storage column savec = "F" for n = 1 to [ A65536]. End (Xlup). row ' initial row content td = ' ' three-column row If tri = 1 Then td = "<tr>" ' Field description td = td + ' <td width= ' 33% ' >Macros are enabled and copied to the code area to see the stitching results. Fully customizable stitching format, full of hands-free tools.
Below, to the Java Development Companion key Note under
If judging condition without parentheses
Conditional judgment equals an equal sign
Format layout must be controlled.
No semicolon
Above, run the description, run the above macro on the current sheet page Alt+f8. Build completed will receive a friendship reminder, OK, happy VBA end.
By. Foam Gold
In 2017-08-17 XI ' an
Excel reads macro code for a column VBA code source and explanation (detailed version)