精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 工具軟件 > 辦公軟件學(xué)習(xí) > Excel教程 > Excel2013教程 > 在Excel2013中怎么將ABCD替換成數(shù)字

      在Excel2013中怎么將ABCD替換成數(shù)字

      時(shí)間: 張偉670 分享

      在Excel2013中怎么將ABCD替換成數(shù)字

        經(jīng)常給別人做數(shù)據(jù)分析,拿到的數(shù)據(jù)都是很不規(guī)范的,比如下面這個(gè)例子,單元格中的數(shù)據(jù)是ABCD而不是數(shù)字1234,這樣的數(shù)據(jù)是無(wú)法放入到spss中進(jìn)行處理的,所以我們需要對(duì)這個(gè)進(jìn)行重新編碼,在Excel中使用vba是比較快速的方法,下面下編就教你具體步驟:

        Excel2013將ABCD替換成數(shù)字的步驟:

        明確目標(biāo):把ABCD轉(zhuǎn)換成1234,如圖所示,題目1這一列是我轉(zhuǎn)換完成的,題目3這一列是還沒有進(jìn)行轉(zhuǎn)換的。

        我們使用快捷鍵alt + F11,打開vbe編輯窗口

        摻入一個(gè)模塊:菜單上執(zhí)行【插入】-【模塊】

        將這段代碼粘貼到模塊中:

        Sub 替換abcd()

        Dim iRng As Range

        Set iRng = Selection

        For Each icell In iRng

        txt = icell.Value

        Select Case txt

        Case "A"

        icell.Value = 1

        Case "B"

        icell.Value = 2

        Case "C"

        icell.Value = 3

        Case "D"

        icell.Value = 4

        Case "E"

        icell.Value = 5

        End Select

        Next icell

        End Sub

        保存并關(guān)閉vbe窗口,然后按下快捷鍵alt+F8,打開宏編輯窗口,選中這個(gè)唯一的宏,然后點(diǎn)擊【選項(xiàng)】按鈕

        設(shè)置快捷鍵為Ctrl+q,然后點(diǎn)擊確定按鈕

        下面開始使用這個(gè)宏來(lái)轉(zhuǎn)化數(shù)據(jù),如圖,先選中要轉(zhuǎn)換的這一列,然后按下快捷鍵【Ctrl+q】,你可以看到數(shù)據(jù)快速得到轉(zhuǎn)換。abcd都變成了1234

      400158