excelvba吧 关注:263贴子:262
  • 3回复贴,共1

小白不会写代码 拆分代码要怎么写啊

只看楼主收藏回复


入职测试题 太难了 完全不会


IP属地:湖北1楼2022-11-22 18:02回复
    简单


    2楼2023-01-31 18:57
    回复
      split函数,拆分一下。


      IP属地:河南来自Android客户端3楼2023-02-02 08:07
      回复
        Public Sub test()
        Dim arr, i As Integer, x As Integer, brr
        arr = Array("黑裤", "灰裤", "深灰裤", "天蓝裤")
        With Sheet1
        For i = 0 To UBound(arr)
        .Columns(1).Replace arr(i), "," & arr(i)
        Next
        i = .Range("a65536").End(xlUp).Row
        For x = 2 To i
        brr = Split(.Range("a" & x).Value, ",")
        .Range("b" & x).Resize(1, 3).Value = brr
        Next
        End With
        End Sub


        IP属地:山东4楼2024-10-11 15:52
        回复