[Excel] 문장 끝에 특정 문자 지우기
문장 끝에 .....식으로 마침표가 많다.
그런데 이 "." 를 제거하고 싶을때..
이 매크로를 사용하면 된다.
예시~~
나의나된것은....... -> 나의나된것은
Sub 매크로1()
'
' 매크로1 매크로
'
'
Dim i As Integer
Dim j As Integer
Dim jEnd As Integer
Dim nPosRow As Integer
Dim nPosCol As Integer
Dim TempStr As String
Dim SourceStr As String
nPosCol = ActiveCell.Column
nPosRow = ActiveCell.Row
For i = nPosRow To 10000 Step 1
Cells(i, nPosCol).Select
jEnd = Len(Selection)
SourceStr = Selection
For j = 0 To jEnd Step 1
TempStr = Right(SourceStr, 1)
If TempStr = "." Then
SourceStr = Left(SourceStr, jEnd - j - 1)
ActiveCell = SourceStr
Else
Exit For
End If
Next j
Next i
End Sub