我正在使用下面的代碼來獲取最后一列字母。
它作業正常,但我不明白究竟是什么(0)意思!
根據 MS 檔案和代碼 intellisense,它應該是Limit as integer
但是在這種情況下,它應該像所有其余引數一樣位于 Split 函式本身的括號內
Dim lastCol_L As String
lastCol_L = Split(Cells(1, lastCol_n).Address(True, False), "$")(0)
lastCol_n是來自其他代碼的整數感謝所有有用的答案
uj5u.com熱心網友回復:
我不明白 (0) 到底是什么意思!
它是陣列的第一項。讓我告訴你一個更正統的方式:
Dim lastCol_L As String
'an array of strings
Dim arr() as String
'split the cell by $ sign into an array of strings
arr = Split(Cells(1, lastCol_n).Address(True, False), "$")
'the first item of the array
lastCol_L = arr(0)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/485924.html
上一篇:VBA根據單元格值洗掉行
