Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub SplitCellBySpace()
- Dim Cell, SplitCell() As String
- ActiveCell.Copy ActiveCell.Offset(0, 0)
- ActiveCell.Offset(0, 0).Select
- Cell = ActiveCell.Value
- SplitCell = Split(Cell, " ")
- For i = 0 To UBound(SplitCell)
- ActiveCell.Offset(i, 0).Value = SplitCell(i)
- Next i
- End Sub
- Sub FillEmptyCells()
- For Each c In Selection
- If (IsEmpty(c) Or c.Value = "" Or c.Value = " ") Then
- c.FormulaR1C1 = "=r[-1]C"
- c.Value = c.Value
- End If
- Next c
- End Sub
- Sub SplitToColumns()
- Selection.TextToColumns Destination:=Selection, DataType:=xlDelimited, _
- TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
- Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
- :=Array(Array(1, 1), Array(2, 1), Array(3, 1)), TrailingMinusNumbers:=True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement