|
-
May 8th, 2012, 04:26 AM
#1
Thread Starter
New Member
VBA code to create n number of txt/doc/xls files with specific size.
Hi all,,,,,,,,,
Plzzzzzzz help me with the vb code to create n number of files with specific size.
I have a code which would create text/word/excel files .....But I tried this code to create 'n' number of files....
To be clear.....I need to create 1000 txt files with the content as 'Hello World1' 'Hello word2'.............'Hello World1000' respectively..........
And If i specify the size of the file in a text box then it should create the file with that size.....
But I couldn't make it...................help me this out..........
The following is the code ........
Public Sub veeru()
Const FILENAME = "C:\Users\veeru\Desktop\myfile.xls"
Dim My_filenumber As Integer
My_filenumber = FreeFile
Open FILENAME For Output As #My_filenumber
Write #My_filenumber, "Hello"
Close #My_filenumber End Sub
   
Tags for this Thread
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
|