View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave O Dave O is offline
external usenet poster
 
Posts: 427
Default Code to delete columns meeting a condition

FYI
I looked at the posted version of my message, and one of the lines
wrapped and continued on the next line. If you copy and paste it as I
see it into your VBA editor, the code will give compile errors to the
effect of "if with no end if".

This line of code:
If ActiveCell.Value Range("h1").Value Then

should be followed on the same line with
Selection.EntireColumn.Delete