Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Friend Sub AdjustLowHeightRow()
  2.  
  3. Dim endRow As Integer
  4. endRow = FindEndRowWithGridLine()
  5.  
  6. Dim i As Integer
  7. For i = 1 To endRow
  8. Dim currentRowHeight As Double
  9. currentRowHeight = Rows(i).RowHeight
  10. If (currentRowHeight < 16) Then
  11. Rows(i).RowHeight = 16
  12. End If
  13. Next i
  14.  
  15. End Sub
  16.  
  17. Private Function FindEndRowWithGridLine() As Integer
  18.  
  19. Dim endRow As Integer
  20. endRow = 1
  21. Dim loopExit As Boolean
  22. loopExit = False
  23. Do
  24. Dim currentBorder As Border
  25. Set currentBorder = Cells(endRow, 1).Borders(xlEdgeLeft)
  26. If (currentBorder.LineStyle <> xlContinuous) Then
  27. loopExit = True
  28. End If
  29. endRow = endRow + 1
  30. Loop Until (loopExit)
  31. FindEndRowWithGridLine = endRow
  32.  
  33. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement