Just a little routine to help me write these articles. Given an Excel range it will generate the HTML for a table with some subtle (i.e grey) styling.
Option Explicit
Function MarkupTable(ByVal rng As Excel.Range)
Dim s As String
s = "<table style='border: 1px solid lightgrey;'>"
Dim rngRowLoop As Excel.Range
For Each rngRowLoop In rng.Rows
s = s & "<tr>"
Dim rngCellLoop As Excel.Range
For Each rngCellLoop In rngRowLoop.Cells
s = s & "<td style='border: 1px solid lightgrey;'>" & rngCellLoop.Value2 & "</td>"
Next rngCellLoop
s = s & "</tr>"
Next
s = s & "</table>"
MarkupTable = s
End Function
Sub TestMarkupTable()
Debug.Print MarkupTable(ActiveCell.CurrentRegion)
End Sub
sample
0018095C | IAccessible | Status Bar | MsoCommandBar | Status Bar | |
003400F0 | IAccessible | Ribbon | MsoCommandBar | Ribbon | |
00130E1A | ITextDocument2 | Calibri | RICHEDIT60W | Font Selector? | |
00140D90 | ITextDocument2 | 11 | RICHEDIT60W | Font size selector? | |
000E0F54 | ITextDocument2 | General | RICHEDIT60W | Format selector? | |
000E034C | Window | Book2 | EXCEL7 | True | A window on a workbook |
No comments:
Post a Comment