Header Ads

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

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
Powered by Blogger.