|
-
Mar 29th, 2002, 02:57 PM
#3
Thread Starter
Member
RE: creating textfile
No, what I want to is publish the values from of the excelsheet on the internet. That is why I want to create javascipt commands into a textfile. You can also use the build-in microsoft add-in for creating a table into a HTML file but then if you want to create 32 HTML files with all different tables of different sizes then you cannot use this add-in because the macro recorder does not give you the code.So you cannot automate this in a simple way. So the only thing I need is the text that is quoted above because that is the part of the javascript that is for each table different.
So what I want to know is how to create e.g. the following text:
new Array("48","85"),
new Array("49","45"),
new Array("50","78"),
new Array("51","2"),
new Array("52","90")
This must be flexible for the number of lines. So above you see 5 lines and two cell values but it can also be 7 lines and 5 cell values (I mean by that a table with 35 values).So I want to know how the change the sub below that it is flexibel for both.
Sub create_file()
Dim fso, txtfile
Set fso = CreateObject("scripting.filesystemobject")
Set txtfile = fso.createtextfile("c:\Windows\Desktop\qrt.txt", True)
For x = 1 To 5
txtfile.write ("new Array" & Chr(40) & Chr(34) & Cells(x, 1) & Chr(34) & vbNewLine)
Next x
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|