J1enter
New Member
- Joined
- Nov 17, 2010
- Messages
- 16
Dit VBA script works perfect on my Excel 2013.
But when my colleague, using Excel 2010, runs it, it loops endlessly. Can I make an adjustment in this code to make it run in 2010?
More background on the purpose of this command: In column A there are clientnames with sometimes a trailing space. These need to be deleted. But there are also clientnames with double spaces in between words. These need to stay. Hence the use of RTRIM. Oh..one thing I noticed: the actual name of sheet1 is 'worklist', but the script works on 2013 nonetheless.
Code:
Dim cell As Range, areaToTrim As Range
Set areaToTrim = Sheet1.Range("A:A")
For Each cell In areaToTrim
cell.Value = RTrim(cell.Value)
Next cell
But when my colleague, using Excel 2010, runs it, it loops endlessly. Can I make an adjustment in this code to make it run in 2010?
More background on the purpose of this command: In column A there are clientnames with sometimes a trailing space. These need to be deleted. But there are also clientnames with double spaces in between words. These need to stay. Hence the use of RTRIM. Oh..one thing I noticed: the actual name of sheet1 is 'worklist', but the script works on 2013 nonetheless.
Last edited: