G
Greg
Hi,
Below please find a "Cut Stack Order" subroutine I wrote for Microsoft
Word. This script generates numbers in Cut Stack Order sequence and
saves the numbers into a TXT file. I import this TXT File into an
Excel row next to my data and use that as my Sort field:
Sub CutStackOrder()
Dim fn$, Start, Finish, range, k, j, l$
fn$ = "Numbers.csv"
Open fn$ For Output As 1
Print #1, "num1"
Start = 0
Finish = 30
range = 9
For k = 1 To range
For j = (Start + k) To Finish Step range
l = Format(j, "0000")
Print #1, l
Next j
Next k
Close 1
WordBasic.MsgBox "File: " + fn$ + " has been created!"
End Sub
I wish to use this code in Excel, placing the numbers directly into
the Excel spreadsheet instead of importing them from the TXT file. Can
this be accomplished? Thanks in advance for your assistance.
Regards,
Greg
Below please find a "Cut Stack Order" subroutine I wrote for Microsoft
Word. This script generates numbers in Cut Stack Order sequence and
saves the numbers into a TXT file. I import this TXT File into an
Excel row next to my data and use that as my Sort field:
Sub CutStackOrder()
Dim fn$, Start, Finish, range, k, j, l$
fn$ = "Numbers.csv"
Open fn$ For Output As 1
Print #1, "num1"
Start = 0
Finish = 30
range = 9
For k = 1 To range
For j = (Start + k) To Finish Step range
l = Format(j, "0000")
Print #1, l
Next j
Next k
Close 1
WordBasic.MsgBox "File: " + fn$ + " has been created!"
End Sub
I wish to use this code in Excel, placing the numbers directly into
the Excel spreadsheet instead of importing them from the TXT file. Can
this be accomplished? Thanks in advance for your assistance.
Regards,
Greg