View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Stuart Stuart is offline
external usenet poster
 
Posts: 62
Default VBA output to text editor

Hi,

I have the following VBA code which just is some simple For Loops and can
get the data to be written to Excel cells. But how do I get it to write to a
text editor, such as WordPad or NotePad? I need to do this rather than output
the number to Excel as there insufficient rows in Excel to hold all the data.

Sub counter()

i = 0

For a = 1 To 18
For b = 1 To 18
For c = 1 To 18
For d = 1 To 18
For e = 1 To 18
For f = 1 To 18
i = i + 1
Worksheets("Sheet1").Cells(i, 1) = a
Worksheets("Sheet1").Cells(i, 2) = b
Worksheets("Sheet1").Cells(i, 3) = c
Worksheets("Sheet1").Cells(i, 4) = d
Worksheets("Sheet1").Cells(i, 5) = e
Worksheets("Sheet1").Cells(i, 6) = f
Worksheets("Sheet1").Cells(i, 8) = i
Next
Next
Next
Next
Next
Next

End Sub

Thanks.

Stuart