I need to select all rows smaller than 16 points in order to manually delete them. Programatically deleting them rescales images on the spreadsheet and breaks it (ChemBio generated chemical structures).
My code works up until it makes the selection:
Sub FindAndRemoveSmallRows()
Dim a As Range, b As Range, c As String
Set a = Selection
For Each b In a.Rows
If b.Height < 16 Then
c = c & b.Row & ":" & b.Row & ","
End If
Next
If Right$(c, 1) = "," Then c = Left$(c, Len(c) - 1)
Range(c).Select
End Sub
How can I pass the string (which outputs, e.g., "67:67,513:513,534:534") to Range in order to select the rows?
Selectionhas height>= 16and sincecis emptyRange(c).Selectthrows an error. Can you addMsgBox cjust beforeRange(c).Select. What message would you get?ActiveSheet.Range("C1").Value = cinstead; prints904:904,928:928,968:968,969:969,992:992,1035:1035.Range(c).Select? Did you get any error? If yes, what is the error message?Run-time error '1004':Method 'Range' of object '_Global' failed.