Excel & Dreamweaver

SuperFerret

Well-known Member
Joined
Mar 2, 2009
Messages
515
Hi,

Because my other half has roped me into creating some spreadsheets for him to help write the HTML for a website, I have a few questions.

First I created a simple formula to put the HTML together from a large spreadsheet, but when it's copied into Dreamweaver it puts " around the copied text, any ideas why or how to prevent it?

I was thinking of making a macro to do all the concatenating, indentation and the like and output to a word document but I don't want to waste a lot of time if it's still going to do the same.

Anyone have any Excel to Dreamweaver help/advice? :confused:
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I use Excel to create tables for dumping into Expression Web. You need a page that creates the scaffolding -- in this case, called HTML. Starting in A1:
Code:
<html>
<head>
<title>HTML Table generated from Excel</title>
<link rel="stylesheet" type="text/css" href="tables.css" />
</head>
<body>
<table class="datatable">
Starting in A12:
Code:
</table>
</body>
</html>
The code then harvests data on another sheet, using the scaffolding to put together a valid HTML page. Once that is created you can just copy/paste to DW.

Code for writing the HTML:
Code:
Sub CreateTable()
    Dim iFile As Integer
    Dim fName As String
    Dim i As Long, j As Long
    Dim x As Long, y As Long
    Dim RwLast As Long, ColLast As Long
    
    iFile = FreeFile
    fName = ActiveWorkbook.Path & "\TableOut.htm"
    
    Open fName For Output As FreeFile
    'opening HTML
    For i = 1 To 7
        Print #iFile, Sheets("HTML").Cells(i, 1)
    Next i
    
    'contents of TableData
    Sheets("TableData").Activate
    RwLast = Cells(65536, 1).End(xlUp).Row
    ColLast = Cells(1, 256).End(xlToLeft).Column
    For x = 1 To RwLast
        Print #iFile, "<tr>"
        For y = 1 To ColLast
            If x = 1 Then
                Print #iFile, "  <th>" & Cells(x, y).Value & "</th>"
            Else
                Print #iFile, "  <td>" & Cells(x, y).Value & "</td>"
            End If
        Next y
        Print #iFile, "</tr>"
    Next x
    
    'closing HTML
    For j = 12 To 14
        Print #iFile, Sheets("HTML").Cells(j, 1)
    Next j
    
    'clean up
    Close #iFile
End Sub

Here's the CSS:
Code:
body {
  font-family: Verdana,Arial,Helvetica,"sans serif";
  font-size:1em;
  color:navy;
  background-color: white;
}

table {
    border: 2px solid black;
    background-color: #FFFF99;
    padding: 5px;
    border-collapse: collapse;
}

th {
  color: black;
  background-color: #ddd;
  border: 1px navy solid;
  border-collapse: collapse;
}

td {
  background-color: white;
  border: 1px navy solid;
  border-collapse: collapse;
}

Denis
 
Last edited:
Upvote 0
Thanks Denis,

I'll have to give that a go (trying to learn VBA and HTML at the same time is seriously confusing!) :)
 
Upvote 0

Forum statistics

Threads
1,225,511
Messages
6,185,389
Members
453,289
Latest member
ALPOINT_AIG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top