I'm adding an apostrophe into the cell value using a loop, but with 40k rows of data it takes 5 minutes.
Expand|Select|Wrap|Line Numbers
- ' For iCol = 1 To 8
- ' For lCtr = 2 To lLastRow
- ' Cells(lCtr, iCol).Select
- ' sValue = Selection.Value
- ' If Left(sValue, 1) <> "'" Then
- ' sValue = "'" & sValue
- ' Selection.Value = sValue
- ' End If
- ' Next
- ' Next
I tried using a cell formula which takes 1 minute.
' ActiveCell.FormulaR1C1 = "=""'""&A1"
If my cell value is ABC, the new value becomes 'ABC and cell value length = 4.
I need the cell value length to = 3 but would prefer to use the formula instead of the loop to save time.
Any suggestions?