답변:
이것은 일종의 해결 방법이지만 공식이 아닌 일반 텍스트를 처리하는 경우 작동합니다.
데이터가있는 시트를 "Sheet1"이라고합니다. 스프레드 시트에 새 워크 시트를 작성하고 ( "시트 2"라고 가정) A1에 다음을 입력하십시오.
=IFERROR(LEFT(Sheet1!A1,FIND(" ",Sheet1!A1,FIND(" ",Sheet1!A1,FIND(" ",Sheet1!A1)+1)+1)-1),"")
네 번째 단어 만 삭제하려면 다음을 입력하십시오.
=IFERROR(LEFT(Sheet1!A1,FIND(" ",Sheet1!A1,FIND(" ",Sheet1!A1,FIND(" ",Sheet1!A1)+1)+1))&RIGHT(Sheet1!A1,LEN(Sheet1!A1)-FIND(" ",Sheet1!A1,FIND(" ",Sheet1!A1,FIND(" ",Sheet1!A1,FIND(" ",Sheet1!A1)+1)+1)+1)),IFERROR(LEFT(Sheet1!A1,FIND(" ",Sheet1!A1,FIND(" ",Sheet1!A1,FIND(" ",Sheet1!A1)+1)+1)-1),""))
A1 셀을 복사하여 작업하려는 데이터와 함께 Sheet1의 셀과 일치하는 Sheet2의 셀에 붙여 넣습니다. 따라서 셀 A1-D5의 Sheet1에 데이터가있는 경우 셀 A1-D5의 Sheet2에 붙여 넣습니다. 붙여 넣은 모든 셀을 복사하고 Sheet1로 전환 한 다음 일치하는 지점에 값 을 붙여 넣습니다 . 이제 Sheet2를 삭제할 수 있습니다.
이것은 벽에서 벗어난 아이디어 일 수 있지만 파일을 공백으로 구분 된 파일로 만든 다음 Excel로 열어보십시오. 이제 네 번째 열을 삭제하십시오. 이것은 종이에 잘 들립니다 ... 이 외에는 모르겠습니다.
Visual Basic 매크로에 붙여 넣어도 더 우아하고 효율적인 방법은 다음과 같습니다.
데이터가있는 시트를 "Sheet1"이라고합니다.
"Sub DeleteFourthWord ()"와 "End Sub"사이의 공간에 나타나는 창에 다음을 붙여 넣습니다.
For Each c In ActiveCell.CurrentRegion.Cells
If c.HasFormula = False Then
Original_Cell_Text = c.Value
Text_To_Parse = Original_Cell_Text
Word1 = Left(Text_To_Parse, InStr(1, Text_To_Parse, " ", vbTextCompare))
If Len(Word1) = 0 Then
Word1 = Text_To_Parse
Text_To_Parse = ""
Else
Text_To_Parse = Right(Text_To_Parse, Len(Text_To_Parse) - Len(Word1))
End If
Word2 = Left(Text_To_Parse, InStr(1, Text_To_Parse, " ", vbTextCompare))
If Len(Word2) = 0 Then
Word2 = Text_To_Parse
Text_To_Parse = ""
Else
Text_To_Parse = Right(Text_To_Parse, Len(Text_To_Parse) - Len(Word2))
End If
Word3 = Left(Text_To_Parse, InStr(1, Text_To_Parse, " ", vbTextCompare))
If Len(Word3) = 0 Then
Word3 = Text_To_Parse
Text_To_Parse = ""
Else
Text_To_Parse = Right(Text_To_Parse, Len(Text_To_Parse) - Len(Word3))
End If
Word4 = Left(Text_To_Parse, InStr(1, Text_To_Parse, " ", vbTextCompare))
If Len(Word4) = 0 Then
Word4 = Text_To_Parse
Text_To_Parse = ""
Else
Text_To_Parse = Right(Text_To_Parse, Len(Text_To_Parse) - Len(Word4))
End If
Remaining_Text = Text_To_Parse
If (Len(Word1) > 0 And Len(Word2) > 0 And Len(Word3) > 0 And Len(Word4) > 0) Then
If Len(Remaining_Text) > 0 Then
c.Value = Word1 + Word2 + Word3 + Remaining_Text
Else
c.Value = Word1 + Word2 + Word3
End If
End If
End If
Next
Microsoft Visual Basic 창을 닫고 개발자 탭 에서 매크로 를 클릭 하십시오.
참고 : 세 번째 단어 다음에있는 모든 것을 삭제하려면 대신 붙여 넣으십시오.
For Each c In ActiveCell.CurrentRegion.Cells
If c.HasFormula = False Then
Original_Cell_Text = c.Value
Text_To_Parse = Original_Cell_Text
Word1 = Left(Text_To_Parse, InStr(1, Text_To_Parse, " ", vbTextCompare))
If Len(Word1) = 0 Then
Word1 = Text_To_Parse
Text_To_Parse = ""
Else
Text_To_Parse = Right(Text_To_Parse, Len(Text_To_Parse) - Len(Word1))
End If
Word2 = Left(Text_To_Parse, InStr(1, Text_To_Parse, " ", vbTextCompare))
If Len(Word2) = 0 Then
Word2 = Text_To_Parse
Text_To_Parse = ""
Else
Text_To_Parse = Right(Text_To_Parse, Len(Text_To_Parse) - Len(Word2))
End If
Word3 = Left(Text_To_Parse, InStr(1, Text_To_Parse, " ", vbTextCompare))
If Len(Word3) = 0 Then
Word3 = Text_To_Parse
Text_To_Parse = ""
Else
Text_To_Parse = Right(Text_To_Parse, Len(Text_To_Parse) - Len(Word3))
End If
Remaining_Text = Text_To_Parse
If (Len(Word1) > 0 And Len(Word2) > 0 And Len(Word3) > 0) Then
c.Value = Word1 + Word2 + Word3
End If
End If
Next
(소스 참고 : Excel 도움말 파일에서 개발자 탭을 얻는 방법에 대한 지침을 수정했습니다.)