CarlosTapas
New Member
- Joined
- Sep 27, 2011
- Messages
- 2
Hi (Long time reader first time poster)
As part of a Macro I export a range of cells that I calculate.
I export range A19:DW242 again and again so that it becomes a long dataset of about 70,000+ rows in a seperate sheet..
A then need to “clean” this data by deleting columns that are not required.
However this takes more time than I would like and would welcome some ideas on speeding this relatively simple task up.
The columns to be kept are identified in row 4 when the cell contains “report”
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com
ffice
ffice" /><o
></o
>
Sub deletecolumns()
Dim ginger As Integer
Dim pizza As Integer
Application.ScreenUpdating = False
With Application
.Calculation = xlManual
.MaxChange = 0.001
End With
<o
></o
>
Sheets("Output").Select
pizza = 1
For ginger = 1 To 160
If Cells(4, pizza).Value <> "Report" Then
Columns(pizza).Delete
Else
pizza = pizza + 1
End If
Next ginger
With Application
.Calculation = xlAutomatic
.MaxChange = 0.001
End With
<o
></o
>
Application.ScreenUpdating = True
End Sub
Thank you for you assistance!
As part of a Macro I export a range of cells that I calculate.
I export range A19:DW242 again and again so that it becomes a long dataset of about 70,000+ rows in a seperate sheet..
A then need to “clean” this data by deleting columns that are not required.
However this takes more time than I would like and would welcome some ideas on speeding this relatively simple task up.
The columns to be kept are identified in row 4 when the cell contains “report”
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com




Sub deletecolumns()
Dim ginger As Integer
Dim pizza As Integer
Application.ScreenUpdating = False
With Application
.Calculation = xlManual
.MaxChange = 0.001
End With
<o


Sheets("Output").Select
pizza = 1
For ginger = 1 To 160
If Cells(4, pizza).Value <> "Report" Then
Columns(pizza).Delete
Else
pizza = pizza + 1
End If
Next ginger
With Application
.Calculation = xlAutomatic
.MaxChange = 0.001
End With
<o


Application.ScreenUpdating = True
End Sub
Thank you for you assistance!