ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel data to a web page (https://www.excelbanter.com/excel-programming/310424-excel-data-web-page.html)

ffcyan

Excel data to a web page
 

I need a VB Script or Java Script that allows one to take select dat
(i.e. Range("A1")) from a specific Excel worksheet and place it into
web page. Thank you

--
ffcya
-----------------------------------------------------------------------
ffcyan's Profile: http://www.excelforum.com/member.php...fo&userid=1450
View this thread: http://www.excelforum.com/showthread.php?threadid=26130


Tom Ogilvy

Excel data to a web page
 
this code puts a section in an email using html. Perhaps you can adapt it:
http://www.mrexcel.com/board2/viewtopic.php?t=8251

It will only work with xl2000 or later.
--
Regards,
Tom Ogilvy

"ffcyan" wrote in message
...

I need a VB Script or Java Script that allows one to take select data
(i.e. Range("A1")) from a specific Excel worksheet and place it into a
web page. Thank you.


--
ffcyan
------------------------------------------------------------------------
ffcyan's Profile:

http://www.excelforum.com/member.php...o&userid=14505
View this thread: http://www.excelforum.com/showthread...hreadid=261302




ste mac

Excel data to a web page
 
Hi ffcyan, a mate wrote this code, it works for me...it puts all the
information in a table in a web page...


Const FileName = "C:\My Program\yourplace\All Web
Pages\sheetname.htm"

Dim xlRow As Long
Dim xlCol As Long


Public Sub BallSumsHTML()

Open FileName For Output As #1

Print #1, "<HTML"

' Code below commented out as it is only applicable if you are
using a stylesheet
' in the web site to control layout etc.,

Print #1, " <HEAD"
Print #1, " <titleBall Sums</title"

'Print #1, " <BASE TARGET='MainForm'"
'Print #1, " <META http-equiv='Content-Style-Type'
content='Text/css'"
'Print #1, " <LINK type='text/css' rel='stylesheet'
href='lottery.css'"

Print #1, " </HEAD"
Print #1, " <BODY"
Print #1, " <H1"
Print #1, " <CENTERBall Sums</CENTER"
Print #1, " </H1"
Print #1, " <P"
Print #1, "The table below shows you the ball sums."
Print #1, "<P align = center"
Print #1, " <table border='8'"
Print #1, " <tr"


' This next piece of code reads the xlsheet header information and
builds the
' HTML table header.

For xlCol = 1 To 3

Print #1, " <td align='center'bgcolor='; #fcfcfc; '" &
Sheets("sheet3").Cells(1, xlCol).Value & "</td"

Next

Print #1, " </tr"

' This next piece of code reads the xlsheet information and moves
the
' game data into the HTML table.

xlRow = 2

Do While Not Sheets("sheet3").Cells(xlRow, 1).Value = ""
Print #1, " <tr"

For xlCol = 1 To 3

If Val(Sheets("sheet3").Cells(xlRow, xlCol).Value) < 0 Then

Print #1, " <td align='center'bgcolor = '#cdcccc'" &
Sheets("sheet3").Cells(xlRow, xlCol).Value & "</td"

Else

Print #1, " <td align='center'" &
Sheets("sheet3").Cells(xlRow, xlCol).Value & "</td"

End If
Next

xlRow = xlRow + 1

Loop

Print #1, " </tr"
Print #1, " </TABLE"
Print #1, " <a href = 'menu.htm' go to menu</a"
Print #1, " </BODY"
Print #1, "</HTML"

Close #1

End Sub

hth..

seeya ste


All times are GMT +1. The time now is 03:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com