filmov
tv
Separate Text and Numbers in Excel (4 Easy Ways)
Показать описание
In this video, I will show you four easy ways to separate text and numbers in Excel.
The following four methods are covered in the video:
1. Using Flash Fill
2. Using a Formula
3. Using VBA
4, Using Power Query
-----------------------------------------------------------------------------------
Below are the two VBA codes I have shown in this video:
Function GetNumber(CellRef As String)
Dim StringLength As Integer
StringLength = Len(CellRef)
For i = 1 To StringLength
If IsNumeric(Mid(CellRef, i, 1)) Then Result = Result & Mid(CellRef, i, 1)
Next i
GetNumber = Result
End Function
Function GetText(CellRef As String)
Dim StringLength As Integer
StringLength = Len(CellRef)
For i = 1 To StringLength
If Not (IsNumeric(Mid(CellRef, i, 1))) Then Result = Result & Mid(CellRef, i, 1)
Next i
GetText = Result
End Function
-----------------------------------------------------------------------------------
00:00 Intro
00:26 Separate Text and Numbers using Flash Fill
03:36 Separate Text and Numbers using Formula
08:03 Separate Text and Numbers using VBA
11:37 Separate Text and Numbers using Power Query
#Excel #ExcelTips #ExcelTutorial
The following four methods are covered in the video:
1. Using Flash Fill
2. Using a Formula
3. Using VBA
4, Using Power Query
-----------------------------------------------------------------------------------
Below are the two VBA codes I have shown in this video:
Function GetNumber(CellRef As String)
Dim StringLength As Integer
StringLength = Len(CellRef)
For i = 1 To StringLength
If IsNumeric(Mid(CellRef, i, 1)) Then Result = Result & Mid(CellRef, i, 1)
Next i
GetNumber = Result
End Function
Function GetText(CellRef As String)
Dim StringLength As Integer
StringLength = Len(CellRef)
For i = 1 To StringLength
If Not (IsNumeric(Mid(CellRef, i, 1))) Then Result = Result & Mid(CellRef, i, 1)
Next i
GetText = Result
End Function
-----------------------------------------------------------------------------------
00:00 Intro
00:26 Separate Text and Numbers using Flash Fill
03:36 Separate Text and Numbers using Formula
08:03 Separate Text and Numbers using VBA
11:37 Separate Text and Numbers using Power Query
#Excel #ExcelTips #ExcelTutorial
Комментарии