Jeff H wrote: ↑22 Mar 2021, 21:04
By any chance are you putting the candidates into an unsolved cell with this code?
Yes... I'm putting that string into all cells that do not have a number in them.. unsolved, and then for example looking at a row. If any of the other cells in the row have 1-9 in them I delete that number from the from the string in the cell I'm looking at.
The other subs just set the font size and colour.
BRIEFLY..
so if a row has..
Cell 1 2 3 4 5 6 7 8 9
Contents 3 / 1 2 3 4 5 6 7 8 9 / 1 2 3 4 5 6 7 8 9 / 5 / 7 / 9 / 1 2 3 4 5 6 7 8 9 / 1 / 1 2 3 4 5 6 7 8 9 /
Numeric Y N N Y Y Y N Y N
Then looking at cell 1 I skip it because it's numeric.
For cell 2 I look along the row and remove all "numerics". These are 3 5 7 9 and 1 and put the result back into cell 2. The result is 1 2 4 6 8.
I repeat for each cell and so on.
To delete the numbers from the string I'm using a simple Replace..
slCell = Replace(" " & trim$(slCell) & " ", " " & Cstr(lnglNumber) & " " , " ")
..and then removing double spaces.
HTH
Lisa
Code: Select all
Sub subSetBase( _
rpRange As Range _
)
subSetFontSizeAndColour rpRange
' *********************************************************************
End Sub
Sub subSetBigRed( _
rpRange As Range _
)
subSetFontSizeAndColour rpRange, 24, 255
' *********************************************************************
End Sub
Sub subSetBigBlue( _
rpRange As Range _
)
subSetFontSizeAndColour rpRange, 24, 16763904
' *********************************************************************
End Sub
Sub subSetFontSizeAndColour( _
Optional rpRange As Range = Nothing, _
Optional lngpFontSize As Long = 11, _
Optional lngpFontColour As Long = 0 _
)
' This is here solely to make the calling easier.
' For example..
' subSetBigRed
'
' ColorIndex is limited to 0-57.
'
' Normal Fill colour = -4105
' Green = 5287936
' Red = 255
' Blue = 16763904
' Ordinary black = 0
' Normal Fill
' color = 16777215
' index = -4142
' Dark Green
' color =5287936
' index = 14
' Red vbred color colorindex = 255
' vbred = 3
' index = 3
' color = 255
' Blue = 16763904
' Ordinary black = 0
'
' BOLD is set in any case.
' Font TYPE left alone. Default is usually Calibri.
'
Dim rlRange As Range
If rpRange Is Nothing Then '
Set rlRange = Selection
Else
Set rlRange = rpRange
End If
With rlRange
.Font.Size = lngpFontSize
.Font.Color = lngpFontColour
.Font.Bold = True
End With
' *********************************************************************
End Sub