
SReturn = “.LT.table border=1 rules=all cellpadding=” & DQ & “5” & DQ & “.GT.” VbYesNoCancel + vbQuestion, “DK’s Table Maker”) UseHeaders = MsgBox(“Use Table Headers for your ” & R & “-row by ” & C & “-column table?”, _

‘Check VBE Tools/References Microsoft Forms 2.0 Object Library I used it throughout the Sub().Ĭonst DQ As String * 1 = “””” ‘double double double-quotes And then where I want quotes to appear in the HTML or CSS, I just concatenate in DQ. I trick I use is to define a string*1 constant DQ equal to double double double-quotes (“”””). Getting double-quotes in a text string requires you to escape them with another set of double quotes, creating double double-quotes (“”) and my eyes start to cross. You can get by without it if the parameters are a single word, Arial for instance, but not for Times New Roman. In creating HTML or CSS, many times you need to uses double-quotes (“) around the parameters. The table is a mixture of HTML and deprecated HTML (I’m not a purist.) I played with capturing the font size, but never liked how it came out so I commented it out. To get it there, in the VBE use Tools/References and check the Microsoft Forms 2.0 Object Library. The sub spits the table to the clipboard. It retains Dick’s option to use headers or not.


With Dick’s green light, I created a Sub() that captures each cell’s font family, font style, and font color, as well as the cell’s alignment and background color. I loved that idea, and I asked if I could flesh it out. Dick very recently put up a function that takes an Excel range and whips up some HTML to create a table.
