Advertisement
CleverSnake

pdf_table_normalize.vb

Nov 3rd, 2022
1,437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub SplitCellBySpace()
  2.     Dim Cell, SplitCell() As String
  3.     ActiveCell.Copy ActiveCell.Offset(0, 0)
  4.     ActiveCell.Offset(0, 0).Select
  5.     Cell = ActiveCell.Value
  6.     SplitCell = Split(Cell, " ")
  7.     For i = 0 To UBound(SplitCell)
  8.         ActiveCell.Offset(i, 0).Value = SplitCell(i)
  9.     Next i
  10. End Sub
  11.  
  12. Sub FillEmptyCells()
  13.     For Each c In Selection
  14.         If (IsEmpty(c) Or c.Value = "" Or c.Value = " ") Then
  15.             c.FormulaR1C1 = "=r[-1]C"
  16.             c.Value = c.Value
  17.         End If
  18.     Next c
  19. End Sub
  20.  
  21.  
  22. Sub SplitToColumns()
  23.     Selection.TextToColumns Destination:=Selection, DataType:=xlDelimited, _
  24.         TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
  25.         Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
  26.         :=Array(Array(1, 1), Array(2, 1), Array(3, 1)), TrailingMinusNumbers:=True
  27. End Sub
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement