[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Auto-deleting Date columns in Excel (read this instead!)


  • To: <metastock@xxxxxxxxxxxxxxxxxx>
  • Subject: Auto-deleting Date columns in Excel (read this instead!)
  • From: "SR" <raftsp@xxxxxxxxx>
  • Date: Mon, 23 Sep 2002 05:05:58 -0700
  • In-reply-to: <200209231816.MAA08555@xxxxxxxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links



Here is a sub-routine in VBA that deletes the columns with a "Date" header.
Just paste it in the VBA workbook code and click RUN.
If you like you can create a macro that will call it from inside the Excel
workbook, so you will not
have to switch every time to VBA to run it.
It's also a good idea to use a macro utility to make copy-pasting multiple
indicators between MS and Excel
a single click's task.

Make sure that the first line "Option Compare Text" appears before any other
procedures.
This sub assumes that you use less than 100 columns and less than 10000
rows. If you are using more, then
change the numbers.

Cheers
Spyros


Option Compare Text
_______________________________

Sub DeleteDateColumns()

For x = 1 To 100
    If Cells(1, x) = "DATE" Then
        Range(Cells(1, x), Cells(10000, x)).Select
        Selection.Columns.Delete
        x = x - 1
    End If
Next

End Sub