display natural numbers up to n and write in a text file?

January 23, 2010

Dim num, n, fso, myfile
n= inputbox ("Enter any Value")
num=1
For num= 1 to n step 1
Set fso= createobject ("scripting.filesystemobject")
set myfile=fso.opentextfile ("D:\test.txt", 8, true)
myfile.writeline num
myfile.close
Next

You Might Also Like

0 comments