I need to select the rows in my sheet without background color and I do that, with this code snippet, but I can't figure out how to apply my new Range to a Select. Anyone?
Dim strRange As String
For Each r In .Rows
If r.Interior.ColorIndex = xlColorIndexNone Then
strRange = strRange & returnRangeForRow(r.Address) & ", "
strRange = Right(strRange, (Len(strRange) - 1))
Public Function returnRangeForRow(ByVal strRange As String)
strRange = Right(strRange, (Len(strRange) - InStrRev(strRange, "$"))) '"$A$38"
strRange = strRange & ":" & strRange '"38"
returnRangeForRow = strRange '"38:38"
I tried a million things that I won't list here but I can say it's not as easy as typing: Range("1" & strRange).Select
Selection.PrintOut Copies:=1, Preview:=True, Collate:=True
Moving to C# .NET