delete data in cell after specific character

后端 未结 6 2015
無奈伤痛
無奈伤痛 2021-01-17 16:23

I have data in cells A1:A1000. It is a list of names followed by a small note, like this:

  • sam\" fast
  • nick\" long
  • tom\" quick
<
6条回答
  •  感动是毒
    2021-01-17 16:52

    Here is a nifty trick without macros:

    Select the proper range (or even just click on A to select the entire column) and then do Ctrl+F, click Replace, in Find write exactly "* and leave the Replace with box empty. Now click Replace all and tada !

    It replaces everything after (and including) the quote with nothing because it uses * as a wildcard you left the replace box empty.

    Edit: As suggested here is the VBA code for this:

    Columns("A:A").Replace What:="""*", Replacement:="", LookAt:=xlPart
    

提交回复
热议问题