The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Exporting from Excel


  • To: ukha_d@xxxxxxx
  • Subject: Exporting from Excel
  • From: "Doogie Brodie" <doogiebrodie@xxxxxxx>
  • Date: Thu, 01 Mar 2001 13:42:28 -0000
  • Delivered-to: rich@xxxxxxx
  • Delivered-to: mailing list ukha_d@xxxxxxx
  • Mailing-list: list ukha_d@xxxxxxx; contact ukha_d-owner@xxxxxxx
  • Reply-to: ukha_d@xxxxxxx

(Didn't send properly first time...)
> Good idea Graham, but it produces the same html :-(
>
> The things filled with style tags, and tags I've never even
> heard of!!
> ("x:num" what's that all about?) Search & replace is OK
and
> with enough time
> would work, but I just want a plain table that I can format
> myself. It's
> enough you try to impose your OS on me Microsoft, you won't
> do the same with
> your style of html too!!!

Here I come to save the day.......

(OK so its lunchtime and I'm bored! So forgive sloppyness!)

Go into VB editing in Excel (Alt-F11), make a new Module and chuck
this code in it. Put the cursor inside, press F5 and Robert's yer
fathers brother......

Worked fine on a couple of sheets I tried it on, change rows and
columns variables to suit. Any probs, give me a shout

Cheers

Doogie


Sub MakeHTMLTables()
Dim iRow As Integer
Dim iColumn As Integer
Dim iFreeFile As Integer

'Make HTML table from Excel
'Copyright Doogie Brodie 01/03/01
'Make a new Module and paste into this!

'Change these to suit!!!
'*************************************
Const Columns As Integer = 11
Const Rows As Integer = 100
'*************************************


iFreeFile = FreeFile

Range("A1").Select

Open "c:\test1.htm" For Output As #iFreeFile

Print #1, "<HTML>" & vbCrLf &
"<BODY>" & vbCrLf & "<TABLE>" &
vbCrLf
'Substitute any fancy table shenanigins in here ;->

iRow = 1
iColumn = 65

Do Until iRow = Rows
Print #iFreeFile, "<TR>"
Do Until iColumn = 65 + Columns
Print #iFreeFile, "<TD>" & Range(Chr(iColumn) &
iRow).Value & "</TD>"
iColumn = iColumn + 1
Loop
iColumn = 65
iRow = iRow + 1
Print #iFreeFile, "</TR>"
Loop
Print #1, "</TABLE>" & vbCrLf &
"</BODY>" & vbCrLf & "</HTML>"
&
vbCrLf
Close #1
End Sub


- -- -[Doogie Brodie]- -- -
- -- -[Senior Developer]- -- -
Total Repair Solutions UK
e dbrodie@xxxxxxx
m +44.705.006.9.007
t +44.141.951.1903
f +44.141.951.1588




Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/




Home | Main Index | Thread Index

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.