S
StargateFan
This one will be a largish post because I'm not familiar with which
parts are vital and which aren't. The challenge is that I've been
using the workbook with previous code and today I just stumbled upon
code that incorporates one feature I need but the workbook is
unpolished and I can't start using it over the earlier one as that's
the one I unfortunately worked on. Goodness knows why this one ended
up lost but it did.
Here's the initial code. Its purpose is to create a quotefall
puzzle. I don't remember who r.e.s. is nor which group I recvd this
code in. If you are r.e.s., pls advise. It's been nearly 3 years so
memory isn't so good from that long ago <g>.
*******************************************
'Quotefalls Generator (r.e.s. 2007/2/6)
Sub Make_Quotefalls_Puzzle()
Dim A(100, 100) 'array for ascii codes of quote letters (unsorted)
Dim B(100, 100) 'array for sorted quote letters
Dim x(100) 'array for column
Dim s, t, u 'strings
Dim ascii 'ascii code of a letter
Dim i, j, k, imax, jmax
'get the input quotation from the workbook
s = Worksheets("Quotefalls").Range("B2:B2")
'initialise A and B
For i = 1 To 100
For j = 1 To 100
A(i, j) = Asc(" ") 'ascii code for space
B(i, j) = " " 'space
Next
Next
'create array A from the quote
i = 1
j = 1
jmax = 1
For k = 1 To Len(s)
ascii = Asc(Mid(s, k, 1))
If (ascii <> 10) Then
If j > jmax Then
jmax = j
End If
A(i, j) = ascii
j = j + 1
Else
j = 1
i = i + 1
End If
Next
imax = i 'imax = number of rows of text ascii in A
'jmax = number of columns
'create sorted array B (the "quotefalls")
For j = 1 To jmax
For i = 1 To imax
ascii = A(i, j)
If ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And ascii
<= 122)) Then
x(i) = ascii
Else
x(i) = Asc(" ")
End If
Next
QSort x, 1, imax
ii = 0
For i = 1 To imax
If x(i) <> Asc(" ") Then
ii = ii + 1
B(ii, j) = Chr(x(i))
End If
Next
Next
Worksheets("Quotefalls").Range("4:20").Clear
'write the column-sorted quotation
For i = 1 To imax
For j = 1 To jmax
Worksheets("Quotefalls").Range("B4Z30").Cells(i, j).Select
Selection.Value = B(i, j)
With Selection.Interior
.Color = RGB(255, 255, 200)
.Pattern = xlSolid
End With
If i = 1 Then
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next
Next
'write the quotation template
For i = 1 To imax
For j = 1 To jmax
Worksheets("Quotefalls").Range("B4:B4").Cells(imax + i,
j).Select
Selection.BorderAround _
Color:=Black, Weight:=xlThin
ascii = A(i, j)
If Not ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And
ascii <= 122)) Then
If ascii <> 32 Then
Selection.Value = "'" & Chr(ascii) 'single-quote prefix
for proper display
Else
With Selection.Interior
.Color = RGB(0, 0, 0)
.Pattern = xlSolid
End With
End If
End If
Next
Next
'uncomment next line to automatically copy a quotefalls picture to
the clipboard
'Worksheets("Quotefalls").Range(Cells(4, 2), Cells(4 + 2 * imax -
1, 2 + jmax - 1)) _
' .CopyPicture xlScreen, xlBitmap
Worksheets("Quotefalls").Range("A1:A1").Select
End Sub 'Quotefalls
'quicksort subroutine
Sub QSort(aData, iaDataMin, iaDataMax)
Dim Temp
Dim Buffer
Dim iaDataFirst
Dim iaDataLast
Dim iaDataMid
' Start current low and high at actual low/high
iaDataFirst = iaDataMin
iaDataLast = iaDataMax
' Error!
If iaDataMax <= iaDataMin Then Exit Sub
' Find the approx midpoint of the array
iaDataMid = (iaDataMin + iaDataMax) \ 2
' Pick a starting point
' assume the data *might* be in semi-sorted order already!
Temp = aData(iaDataMid)
Do While (iaDataFirst <= iaDataLast)
'Comparison here
Do While (aData(iaDataFirst) < Temp)
iaDataFirst = iaDataFirst + 1
If iaDataFirst = iaDataMax Then Exit Do
Loop
'Comparison here
Do While (Temp < aData(iaDataLast))
iaDataLast = iaDataLast - 1
If iaDataLast = iaDataMin Then Exit Do
Loop
' if low is <= high then swap
If (iaDataFirst <= iaDataLast) Then
Buffer = aData(iaDataFirst)
aData(iaDataFirst) = aData(iaDataLast)
aData(iaDataLast) = Buffer
iaDataFirst = iaDataFirst + 1
iaDataLast = iaDataLast - 1
End If
Loop
' Recurse if necessary
If iaDataMin < iaDataLast Then
QSort aData, iaDataMin, iaDataLast
End If
' Recurse if necessary
If iaDataFirst < iaDataMax Then
QSort aData, iaDataFirst, iaDataMax
End If
End Sub 'QSort
*******************************************
I'm going to paste the 2nd book's code, hope it isn't too confusing:
*******************************************
'Quotefalls Generator (r.e.s. 2007/2/25)
Sub Quotefalls()
Dim A(10, 50) 'array for ascii codes of quote letters (unsorted)
Dim B(10, 50) 'array for sorted quote letters
Dim x(500) 'array for possibly-merged columns
Dim s, t, u 'strings
Dim ascii 'ascii code of a letter
Dim i, j, k, imax, jmax, nc
Dim Qf_Range 'maximum range for display of quotefalls
Dim fill 'indicates whether to fill-in the solution
'get the input quotation from the workbook
s = Cells(2, 2)
'get the number of columns to have merged clues
nc = CInt(Cells(8, 32))
'get the choice of whether to fill in the solution
fill = Cells(8, 41)
'set the display range
Set Qf_Range = Range("B13Z100")
'initialise arrays A, B
For i = 1 To 10
For j = 1 To 50
A(i, j) = Asc(" ") 'ascii code for space
B(i, j) = " " 'space
Next
Next
'place the quote's ascii codes in array A
i = 1
j = 1
jmax = 1
For k = 1 To Len(s)
ascii = Asc(Mid(s, k, 1))
If (ascii <> 10) Then
If j > jmax Then
jmax = j
If jmax > 50 Then
MsgBox ("The number of columns cannot exceed 50.")
Exit Sub
End If
End If
A(i, j) = ascii
j = j + 1
Else
j = 1
i = i + 1
If i > 10 Then
MsgBox ("The number of rows cannot exceed 10.")
Exit Sub
End If
End If
Next
If nc > jmax Then
MsgBox ("Column group size cannot exceed the number of
columns.")
Exit Sub
End If
imax = i 'imax = number of rows of text ascii in A
'jmax = number of columns
'create sorted array B (the "quotefalls")
For j = 1 To jmax Step nc
'kmax = max number of columns in current merged group
kmax = nc
If j + nc - 1 > jmax Then kmax = (jmax Mod nc)
For i = 1 To imax
For k = 1 To kmax
ascii = A(i, j + k - 1)
If ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And
ascii <= 122)) Then
x(nc * (i - 1) + k) = ascii
Else
x(nc * (i - 1) + k) = Asc(" ")
End If
Next
Next
QSort x, 1, nc * imax
ii = 0
k = 0
For i = 1 To nc * imax
If x(i) <> Asc(" ") Then
If k = 0 Then ii = ii + 1
B(ii, j + k) = Chr(x(i))
k = (k + 1) Mod kmax
End If
Next
For i = 1 To nc * imax
x(i) = Asc(" ")
Next
Next
Qf_Range.Clear
'write the column-sorted quotation
For i = 1 To imax
For j = 1 To jmax
Qf_Range.Cells(i, j).Select
Selection.Value = B(i, j)
With Selection.Interior
.Color = RGB(255, 255, 200)
.Pattern = xlSolid
End With
If i = 1 Then
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
If (j - 1) Mod nc = 0 Then
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
If j = jmax Then
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next
Next
'write the quotation template (including the solution if fill = Y
or y)
For i = 1 To imax
For j = 1 To jmax
Qf_Range.Cells(imax + i, j).Select
Selection.BorderAround _
Color:=Black, Weight:=xlThin
ascii = A(i, j)
If Not ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And
ascii <= 122)) Then
If ascii <> 32 Then
Selection.Value = "'" & Chr(ascii) 'single-quote prefix
for proper display
Else
With Selection.Interior
.Color = RGB(0, 0, 0)
.Pattern = xlSolid
End With
End If
Else
If (fill = "Y" Or fill = "y") Then Selection.Value =
Chr(ascii)
End If
Next
Next
Cells(2, 2).Select
End Sub 'Quotefalls
'quicksort subroutine
Sub QSort(aData, iaDataMin, iaDataMax)
Dim Temp
Dim Buffer
Dim iaDataFirst
Dim iaDataLast
Dim iaDataMid
' Start current low and high at actual low/high
iaDataFirst = iaDataMin
iaDataLast = iaDataMax
' Error!
If iaDataMax <= iaDataMin Then Exit Sub
' Find the approx midpoint of the array
iaDataMid = (iaDataMin + iaDataMax) \ 2
' Pick a starting point
' assume the data *might* be in semi-sorted order already!
Temp = aData(iaDataMid)
Do While (iaDataFirst <= iaDataLast)
'Comparison here
Do While (aData(iaDataFirst) < Temp)
iaDataFirst = iaDataFirst + 1
If iaDataFirst = iaDataMax Then Exit Do
Loop
'Comparison here
Do While (Temp < aData(iaDataLast))
iaDataLast = iaDataLast - 1
If iaDataLast = iaDataMin Then Exit Do
Loop
' if low is <= high then swap
If (iaDataFirst <= iaDataLast) Then
Buffer = aData(iaDataFirst)
aData(iaDataFirst) = aData(iaDataLast)
aData(iaDataLast) = Buffer
iaDataFirst = iaDataFirst + 1
iaDataLast = iaDataLast - 1
End If
Loop
' Recurse if necessary
If iaDataMin < iaDataLast Then
QSort aData, iaDataMin, iaDataLast
End If
' Recurse if necessary
If iaDataFirst < iaDataMax Then
QSort aData, iaDataFirst, iaDataMax
End If
End Sub 'QSort
*******************************************
The reason for posting both will now be made clear. Though the
procedure is clunky, if I put a Y in a box, then the puzzle would be
re-created _with_ the solution.
I'd rather not have that method. I'd rather assign a specific button
in my floating toolbar to it (XL2003) rather than having to actually
type in specific code.
I was hoping I could somehow figure this out on my own but no go. I
tried creating a second button and assigned the 2nd script to it but
when it looped without doing anything remembered I was missing
inputing the "Y". So ended up having to come here anyway.
I hope that it's just a question of adding something simple to the
first script that is found in the second one without user input. Just
the fact that the solution button is being pressed should be the go-
ahead to re-create the same identical puzzle with the solution dropped
down into the boxes instead of being empty.
*****************************
"Y" part:
'write the quotation template (including the solution if fill = Y or
y)
For i = 1 To imax
For j = 1 To jmax
Qf_Range.Cells(imax + i, j).Select
Selection.BorderAround _
Color:=Black, Weight:=xlThin
ascii = A(i, j)
If Not ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And
ascii <= 122)) Then
If ascii <> 32 Then
Selection.Value = "'" & Chr(ascii) 'single-quote prefix
for proper display
Else
With Selection.Interior
.Color = RGB(0, 0, 0)
.Pattern = xlSolid
End With
End If
Else
If (fill = "Y" Or fill = "y") Then Selection.Value =
Chr(ascii)
End If
Next
Next
Cells(2, 2).Select
*****************************
Thank you so much in advance! This would be the best Xmas present to
finally have a working file where I don't manually have to enter in
the solution.
Thanks! D
parts are vital and which aren't. The challenge is that I've been
using the workbook with previous code and today I just stumbled upon
code that incorporates one feature I need but the workbook is
unpolished and I can't start using it over the earlier one as that's
the one I unfortunately worked on. Goodness knows why this one ended
up lost but it did.
Here's the initial code. Its purpose is to create a quotefall
puzzle. I don't remember who r.e.s. is nor which group I recvd this
code in. If you are r.e.s., pls advise. It's been nearly 3 years so
memory isn't so good from that long ago <g>.
*******************************************
'Quotefalls Generator (r.e.s. 2007/2/6)
Sub Make_Quotefalls_Puzzle()
Dim A(100, 100) 'array for ascii codes of quote letters (unsorted)
Dim B(100, 100) 'array for sorted quote letters
Dim x(100) 'array for column
Dim s, t, u 'strings
Dim ascii 'ascii code of a letter
Dim i, j, k, imax, jmax
'get the input quotation from the workbook
s = Worksheets("Quotefalls").Range("B2:B2")
'initialise A and B
For i = 1 To 100
For j = 1 To 100
A(i, j) = Asc(" ") 'ascii code for space
B(i, j) = " " 'space
Next
Next
'create array A from the quote
i = 1
j = 1
jmax = 1
For k = 1 To Len(s)
ascii = Asc(Mid(s, k, 1))
If (ascii <> 10) Then
If j > jmax Then
jmax = j
End If
A(i, j) = ascii
j = j + 1
Else
j = 1
i = i + 1
End If
Next
imax = i 'imax = number of rows of text ascii in A
'jmax = number of columns
'create sorted array B (the "quotefalls")
For j = 1 To jmax
For i = 1 To imax
ascii = A(i, j)
If ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And ascii
<= 122)) Then
x(i) = ascii
Else
x(i) = Asc(" ")
End If
Next
QSort x, 1, imax
ii = 0
For i = 1 To imax
If x(i) <> Asc(" ") Then
ii = ii + 1
B(ii, j) = Chr(x(i))
End If
Next
Next
Worksheets("Quotefalls").Range("4:20").Clear
'write the column-sorted quotation
For i = 1 To imax
For j = 1 To jmax
Worksheets("Quotefalls").Range("B4Z30").Cells(i, j).Select
Selection.Value = B(i, j)
With Selection.Interior
.Color = RGB(255, 255, 200)
.Pattern = xlSolid
End With
If i = 1 Then
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next
Next
'write the quotation template
For i = 1 To imax
For j = 1 To jmax
Worksheets("Quotefalls").Range("B4:B4").Cells(imax + i,
j).Select
Selection.BorderAround _
Color:=Black, Weight:=xlThin
ascii = A(i, j)
If Not ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And
ascii <= 122)) Then
If ascii <> 32 Then
Selection.Value = "'" & Chr(ascii) 'single-quote prefix
for proper display
Else
With Selection.Interior
.Color = RGB(0, 0, 0)
.Pattern = xlSolid
End With
End If
End If
Next
Next
'uncomment next line to automatically copy a quotefalls picture to
the clipboard
'Worksheets("Quotefalls").Range(Cells(4, 2), Cells(4 + 2 * imax -
1, 2 + jmax - 1)) _
' .CopyPicture xlScreen, xlBitmap
Worksheets("Quotefalls").Range("A1:A1").Select
End Sub 'Quotefalls
'quicksort subroutine
Sub QSort(aData, iaDataMin, iaDataMax)
Dim Temp
Dim Buffer
Dim iaDataFirst
Dim iaDataLast
Dim iaDataMid
' Start current low and high at actual low/high
iaDataFirst = iaDataMin
iaDataLast = iaDataMax
' Error!
If iaDataMax <= iaDataMin Then Exit Sub
' Find the approx midpoint of the array
iaDataMid = (iaDataMin + iaDataMax) \ 2
' Pick a starting point
' assume the data *might* be in semi-sorted order already!
Temp = aData(iaDataMid)
Do While (iaDataFirst <= iaDataLast)
'Comparison here
Do While (aData(iaDataFirst) < Temp)
iaDataFirst = iaDataFirst + 1
If iaDataFirst = iaDataMax Then Exit Do
Loop
'Comparison here
Do While (Temp < aData(iaDataLast))
iaDataLast = iaDataLast - 1
If iaDataLast = iaDataMin Then Exit Do
Loop
' if low is <= high then swap
If (iaDataFirst <= iaDataLast) Then
Buffer = aData(iaDataFirst)
aData(iaDataFirst) = aData(iaDataLast)
aData(iaDataLast) = Buffer
iaDataFirst = iaDataFirst + 1
iaDataLast = iaDataLast - 1
End If
Loop
' Recurse if necessary
If iaDataMin < iaDataLast Then
QSort aData, iaDataMin, iaDataLast
End If
' Recurse if necessary
If iaDataFirst < iaDataMax Then
QSort aData, iaDataFirst, iaDataMax
End If
End Sub 'QSort
*******************************************
I'm going to paste the 2nd book's code, hope it isn't too confusing:
*******************************************
'Quotefalls Generator (r.e.s. 2007/2/25)
Sub Quotefalls()
Dim A(10, 50) 'array for ascii codes of quote letters (unsorted)
Dim B(10, 50) 'array for sorted quote letters
Dim x(500) 'array for possibly-merged columns
Dim s, t, u 'strings
Dim ascii 'ascii code of a letter
Dim i, j, k, imax, jmax, nc
Dim Qf_Range 'maximum range for display of quotefalls
Dim fill 'indicates whether to fill-in the solution
'get the input quotation from the workbook
s = Cells(2, 2)
'get the number of columns to have merged clues
nc = CInt(Cells(8, 32))
'get the choice of whether to fill in the solution
fill = Cells(8, 41)
'set the display range
Set Qf_Range = Range("B13Z100")
'initialise arrays A, B
For i = 1 To 10
For j = 1 To 50
A(i, j) = Asc(" ") 'ascii code for space
B(i, j) = " " 'space
Next
Next
'place the quote's ascii codes in array A
i = 1
j = 1
jmax = 1
For k = 1 To Len(s)
ascii = Asc(Mid(s, k, 1))
If (ascii <> 10) Then
If j > jmax Then
jmax = j
If jmax > 50 Then
MsgBox ("The number of columns cannot exceed 50.")
Exit Sub
End If
End If
A(i, j) = ascii
j = j + 1
Else
j = 1
i = i + 1
If i > 10 Then
MsgBox ("The number of rows cannot exceed 10.")
Exit Sub
End If
End If
Next
If nc > jmax Then
MsgBox ("Column group size cannot exceed the number of
columns.")
Exit Sub
End If
imax = i 'imax = number of rows of text ascii in A
'jmax = number of columns
'create sorted array B (the "quotefalls")
For j = 1 To jmax Step nc
'kmax = max number of columns in current merged group
kmax = nc
If j + nc - 1 > jmax Then kmax = (jmax Mod nc)
For i = 1 To imax
For k = 1 To kmax
ascii = A(i, j + k - 1)
If ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And
ascii <= 122)) Then
x(nc * (i - 1) + k) = ascii
Else
x(nc * (i - 1) + k) = Asc(" ")
End If
Next
Next
QSort x, 1, nc * imax
ii = 0
k = 0
For i = 1 To nc * imax
If x(i) <> Asc(" ") Then
If k = 0 Then ii = ii + 1
B(ii, j + k) = Chr(x(i))
k = (k + 1) Mod kmax
End If
Next
For i = 1 To nc * imax
x(i) = Asc(" ")
Next
Next
Qf_Range.Clear
'write the column-sorted quotation
For i = 1 To imax
For j = 1 To jmax
Qf_Range.Cells(i, j).Select
Selection.Value = B(i, j)
With Selection.Interior
.Color = RGB(255, 255, 200)
.Pattern = xlSolid
End With
If i = 1 Then
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
If (j - 1) Mod nc = 0 Then
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
If j = jmax Then
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next
Next
'write the quotation template (including the solution if fill = Y
or y)
For i = 1 To imax
For j = 1 To jmax
Qf_Range.Cells(imax + i, j).Select
Selection.BorderAround _
Color:=Black, Weight:=xlThin
ascii = A(i, j)
If Not ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And
ascii <= 122)) Then
If ascii <> 32 Then
Selection.Value = "'" & Chr(ascii) 'single-quote prefix
for proper display
Else
With Selection.Interior
.Color = RGB(0, 0, 0)
.Pattern = xlSolid
End With
End If
Else
If (fill = "Y" Or fill = "y") Then Selection.Value =
Chr(ascii)
End If
Next
Next
Cells(2, 2).Select
End Sub 'Quotefalls
'quicksort subroutine
Sub QSort(aData, iaDataMin, iaDataMax)
Dim Temp
Dim Buffer
Dim iaDataFirst
Dim iaDataLast
Dim iaDataMid
' Start current low and high at actual low/high
iaDataFirst = iaDataMin
iaDataLast = iaDataMax
' Error!
If iaDataMax <= iaDataMin Then Exit Sub
' Find the approx midpoint of the array
iaDataMid = (iaDataMin + iaDataMax) \ 2
' Pick a starting point
' assume the data *might* be in semi-sorted order already!
Temp = aData(iaDataMid)
Do While (iaDataFirst <= iaDataLast)
'Comparison here
Do While (aData(iaDataFirst) < Temp)
iaDataFirst = iaDataFirst + 1
If iaDataFirst = iaDataMax Then Exit Do
Loop
'Comparison here
Do While (Temp < aData(iaDataLast))
iaDataLast = iaDataLast - 1
If iaDataLast = iaDataMin Then Exit Do
Loop
' if low is <= high then swap
If (iaDataFirst <= iaDataLast) Then
Buffer = aData(iaDataFirst)
aData(iaDataFirst) = aData(iaDataLast)
aData(iaDataLast) = Buffer
iaDataFirst = iaDataFirst + 1
iaDataLast = iaDataLast - 1
End If
Loop
' Recurse if necessary
If iaDataMin < iaDataLast Then
QSort aData, iaDataMin, iaDataLast
End If
' Recurse if necessary
If iaDataFirst < iaDataMax Then
QSort aData, iaDataFirst, iaDataMax
End If
End Sub 'QSort
*******************************************
The reason for posting both will now be made clear. Though the
procedure is clunky, if I put a Y in a box, then the puzzle would be
re-created _with_ the solution.
I'd rather not have that method. I'd rather assign a specific button
in my floating toolbar to it (XL2003) rather than having to actually
type in specific code.
I was hoping I could somehow figure this out on my own but no go. I
tried creating a second button and assigned the 2nd script to it but
when it looped without doing anything remembered I was missing
inputing the "Y". So ended up having to come here anyway.
I hope that it's just a question of adding something simple to the
first script that is found in the second one without user input. Just
the fact that the solution button is being pressed should be the go-
ahead to re-create the same identical puzzle with the solution dropped
down into the boxes instead of being empty.
*****************************
"Y" part:
'write the quotation template (including the solution if fill = Y or
y)
For i = 1 To imax
For j = 1 To jmax
Qf_Range.Cells(imax + i, j).Select
Selection.BorderAround _
Color:=Black, Weight:=xlThin
ascii = A(i, j)
If Not ((ascii >= 65 And ascii <= 90) Or (ascii >= 97 And
ascii <= 122)) Then
If ascii <> 32 Then
Selection.Value = "'" & Chr(ascii) 'single-quote prefix
for proper display
Else
With Selection.Interior
.Color = RGB(0, 0, 0)
.Pattern = xlSolid
End With
End If
Else
If (fill = "Y" Or fill = "y") Then Selection.Value =
Chr(ascii)
End If
Next
Next
Cells(2, 2).Select
*****************************
Thank you so much in advance! This would be the best Xmas present to
finally have a working file where I don't manually have to enter in
the solution.
Thanks! D