LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default delete columns based on value in one cell

Excel 2003 - I am trying to delete columns A through D based on the value of
cell 1, column IT:

If cell 1, column IT = 65536, delete columns A through D

This is what I have come up with:

Sub DeleteColumns()

If Cells("1,IT") = "65536" Then
Columns("A:D").delete
End If

End Sub

I get a run time error 13, type mismatch.

I have tried using column numbers instead, but am still having no luck.

(huge file, lots of mixed data I'm filtering using columns IS and IT)

Thank you so much for any help you can give.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete columns based on cell value Robert H Excel Programming 6 February 1st 07 01:40 PM
Delete Row Based On Two Columns Kris Excel Programming 8 July 6th 06 12:44 AM
How can I delete a row based on Columns H and I ICSAnalyst[_3_] Excel Programming 1 November 16th 04 10:19 AM
How can I delete a row based on Columns H and I ICSAnalyst[_4_] Excel Programming 1 November 15th 04 09:15 PM
Delete Columns based on a condition Joel Mills Excel Programming 3 August 6th 04 07:21 PM


All times are GMT +1. The time now is 10:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"