how to insert numbers before every word in excel

前端 未结 2 1906
梦毁少年i
梦毁少年i 2021-01-16 06:02

http://imgur.com/ekrjv0D

Hi please check above image. Is there any way to insert number before each word in worksheet.
I have a table like this:

         


        
2条回答
  •  日久生厌
    2021-01-16 06:30

    Try this short macro:

    Sub marine()
       Dim n As Long
       Dim r As Range
       n = 1
    
       For Each r In ActiveSheet.UsedRange
          If r.Value <> "" Then
             r.Value = n & "/" & r.Value
             n = n + 1
          End If
       Next r
    End Sub
    

提交回复
热议问题