By using listi.net you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

listi.net

 


CreateTable UDF


Function CreateTable(firstCol, lastCol, firstRow, lastRow, Optional bEntireTable)
if IsMissing(bEntireTable) then
   bEntireTable = True
End If

if bEntireTable then
   s = "< table border=1 class=sample bordercolor=#9CC2E5>"
End If

For i = firstRow to lastRow
   s = s & "< tr>"
   For j = firstCol to lastCol
      If Cells(i, j) = "" then
            'won't work if blank row
            Goto next_for
      else
            s = s  & "< td>" & FixHTML(Cells(i, j)) & "< /td>"
      End If

next_for:

   Next
   s = s & "< /tr>"


Next

if bEntireTabe Then
   s = s & "< /table>"
End If

CreateTable = s
End Function
blog comments powered by Disqus