I think I'm half way there, I've found various rather complex solutions while googling but I'm pretty sure there's an easier way than what I'm doing.
As shown in the screenshots, I'd like the user to select rows by picking cells, then the macro to return from those selections a series of rows, and colour them.
I've got as far as getting a string with the row numbers in, but I can't find a good example of the syntax to reference this in a row selection.
Code
Sub Test_B(control As IRibbonControl)
'
' RESET DATE
'
Dim NonCogRange As Range
Dim c As Range
Dim CellCount As Range
Dim ColCnt, RowCnt As Integer
Dim StrRow As String
Set CellCount = Selection
For Each NonCogRange In CellCount.Areas
For Each c In NonCogRange.Cells
c.FormulaR1C1 = "Row # :" & c.Row
If c.Row <> CellCountR Then
CellCountR = c.Row
StrRow = StrRow & "," & CellCountR
End If
Next c
Next NonCogRange
Range("a1").FormulaR1C1 = "Rows(" & Right(StrRow, Len(StrRow) - 1) & ")"
End Sub
Display More
[ATTACH=CONFIG]69477[/ATTACH]
[ATTACH=CONFIG]69476[/ATTACH]