Hi
I am new at macros and VBA editing.
I wanted to split txt form numbers in cells so I putted this code in module:
Public Function SplitText(pWorkRng As Range, pIsNumber As Boolean) As String
'Updateby20150306
Dim xLen As Long
Dim xStr As String
xLen = VBA.Len(pWorkRng.Value)
For i = 1 To xLen
xStr = VBA.Mid(pWorkRng.Value, i, 1)
If ((VBA.IsNumeric(xStr) And pIsNumber) Or (Not (VBA.IsNumeric(xStr)) And Not (pIsNumber))) Then
SplitText = SplitText + xStr
End If
Next
End Function
The code worked but I wanted to have a button that would be on my ribbon. When I want to add it I can't see this macro in the macro list. All others are there.
What am I doing wrong???
I am new at macros and VBA editing.
I wanted to split txt form numbers in cells so I putted this code in module:
Public Function SplitText(pWorkRng As Range, pIsNumber As Boolean) As String
'Updateby20150306
Dim xLen As Long
Dim xStr As String
xLen = VBA.Len(pWorkRng.Value)
For i = 1 To xLen
xStr = VBA.Mid(pWorkRng.Value, i, 1)
If ((VBA.IsNumeric(xStr) And pIsNumber) Or (Not (VBA.IsNumeric(xStr)) And Not (pIsNumber))) Then
SplitText = SplitText + xStr
End If
Next
End Function
The code worked but I wanted to have a button that would be on my ribbon. When I want to add it I can't see this macro in the macro list. All others are there.
What am I doing wrong???