This document discusses using VBA code to replace special characters like tabs and line feeds in Excel cells. It explains that the code loops through each cell in a range, stores the cell value in a string, replaces special characters in the string, and writes the modified string back to the cell. Special characters like tabs, line feeds, and carriage returns are replaced with spaces to clean up cell values for further processing.
4. Dim i As Integer, j As Integer
Dim rowNum As Integer
Dim ORG As String
rowNum = Range("A65536").End(xlUp).Row
A
End(xlUp).Row
(https://www.moug.net/tech/exvba/0050088.html)
5. For i = 1 To 2
For j = 1 To rowNum
ORG = ActiveSheet.Cells(j, i).Value
ORG = Replace(ORG, vbTab, " ")
ORG = Replace(ORG, vbCrLf, " ")
ActiveSheet.Cells(j, i).Value = _
Replace(ORG, Chr(10), " ")
Next j
Next i
i (1 2 =A&B ) J (1
rowNum )
6. For i = 1 To 2
For j = 1 To rowNum
ORG = ActiveSheet.Cells(j, i).Value
ORG = Replace(ORG, vbTab, " ")
ORG = Replace(ORG, vbCrLf, " ")
ActiveSheet.Cells(j, i).Value = _
Replace(ORG, Chr(10), " ")
Next j
Next i
Cells(j,i) String
Replace vbTab vbCrLf Chr(10)
Cells(i,j)