Search for time format (HH:MM:SS) and delete the column that contains it.

Serv

New Member
Joined
Feb 2, 2022
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
I have many reports that are auto generated by Maximo, I have to format a bunch of these each week. The Columns change from report to report and sometimes week to week so I have to be able to search for a Timestamp and delete the column associated with it. The Column in question is always Merged with at least 1 other column that has the date. I want to keep the date and delete the column with the time. I am not sure what the search value is that I need apparently timestamp isn't right but someone suggested the below and it doesn't do anything. Any help would be greatly appreciated. Put in example of my file if that is at all helpful.

Sub DeleteTime()
Dim Cell As Range

For Each Cell In Range("A:Z")
If Cell.Value = String(":00") Then
Cell.EntireColumn.Delete
End If
Next Cell

End Sub
 

Attachments

  • Untitled.png
    Untitled.png
    53.7 KB · Views: 11

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,215,408
Messages
6,124,727
Members
449,185
Latest member
ekrause77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top