我正在尝试在每个单元格中添加分隔符。
但是这段代码在所有单元格上添加分隔符是否为空,我只在非空单元格上需要分隔符。
你能帮我吗,tks很多
Dim Range As Object, Line As Object, Cell As Object
Dim StrTemp, chemin As String
Dim Separateur As String
Separateur = ","
'WBDest.Activate
Set Range = Worksheets(1).Columns(i)
'Set Range = Worksheets(1).Columns(i).SpecialCells(xlCellTypeBlanks) ' Not work
Open "C:\export\" + Str(i) + ".csv" For Output As #1
For Each Line In Range.Rows
StrTemp = ""
For Each Cell In Line.Cells
StrTemp = StrTemp & CStr _
(Cell.Text) & Separateur
Next
Print #1, StrTemp '= " "
Next
Close