andycreber
Board Regular
- Joined
- May 20, 2010
- Messages
- 74
- Office Version
- 2016
I am using this bit of code in my macro I found to nearly work but could someone please tell me what this means
For lRow = 353 To 2 Step -1
does it only go down to row 353?
I want it to work on columns B & C only, thanks
The full code is:
For lRow = 353 To 2 Step -1
does it only go down to row 353?
I want it to work on columns B & C only, thanks
The full code is:
Code:
Dim lRow As Integer
Dim intCol As Long
Dim rngCell As Range, fn
Set fn = Application.WorksheetFunction
For intCol = 2 To 3
For lRow = 353 To 2 Step -1
Set rngCell = Cells(lRow, intCol)
With rngCell
.Value = fn.Substitute(rngCell.Value, Chr(160), Chr(32))
.Value = Trim(rngCell.Value)
End With
If Len(rngCell) = 0 Then
rngCell.Delete shift:=xlUp
End If
Set rngCell = Nothing
Next lRow
Next intCol
Last edited by a moderator: