I need help with this.
I have column A ( which to be used as the file name)
and the data should be saved as Column B but in HTML format
The output should be HTML file and when you open it you will find the data from column B
HELP.png
Sub SaveAs_HTML()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fs, f, ts, s
Dim WS_Src As Worksheet, Rng As Range, c As Range, d As Range
Dim Folder As String
Folder = "C:"
Set WS_Src = ThisWorkbook.Worksheets("a")
Set Rng = WS_Src.Range("a1", WS_Src.Range("a" & Rows.Count).End(xlUp))
For Each c In Rng
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CreateTextFile Folder & c.Value & ".html"
Set f = fs.GetFile(Folder & c.Value & ".html")
Set ts = f.OpenAsTextStream(ForWriting, TristateUseDefault)
For Each d In Intersect(c.EntireRow, WS_Src.UsedRange)
ts.write d.Value & Chr(9)
Next
ts.Close
Next
End Sub
it turned out like this
Untitled.png
How can Column A not show in HTML file? without deleting it ? because i need that row for naming all files
Bookmarks