Excel reads macro code for a column VBA code source and explanation (detailed version)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.