ThrottleWorks
Excel Ninja
I am using below mentioned code to trim the data.
This code takes time to complete the opetation.
I wanted to know, is there more efficient way to do this.
Background about the code - This (code) is part of another macro.
The macro opens the file, copies the data based on the criteria and paste in the report.
Since this code trims the data from approx 200 files it takes time to run.
And without trimming data I can not go further.
What I am doing in the code is, if cell is non blank then trim else leave.
Can anyone please help me in this.
Not uploading sample file due to some reason but please let me know if required.
Code:
Dim Ducati As Range
Set Ducati = Range(Cells(1, 1), Cells(LRw, LCol))
For Each cell In Ducati ' Ducati is defined as range
If cell.Value <> "" Then
cell.Select
ActiveCell = Trim(ActiveCell)
End If
Next
This code takes time to complete the opetation.
I wanted to know, is there more efficient way to do this.
Background about the code - This (code) is part of another macro.
The macro opens the file, copies the data based on the criteria and paste in the report.
Since this code trims the data from approx 200 files it takes time to run.
And without trimming data I can not go further.
What I am doing in the code is, if cell is non blank then trim else leave.
Can anyone please help me in this.
Not uploading sample file due to some reason but please let me know if required.