Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Hide Column Based on Partial Text Match in Header

Hi, found this macro on this newsgroup. Sorry, forgot to copy person's name.

How do I convert this so it matches partial text? I tried "*City1*" etc,
but didn't work.

Thanks very much!

Stevec

Public Sub Tester003()
Dim Col As Range
Dim arrCities As Variant

arrCities = Array("City1", "City2", "City3", "City4", "City5")

For Each Col In ActiveSheet.UsedRange.Columns
If IsError(Application.Match _
(Col.Cells(1).Value, arrCities, 0)) Then
Col.Hidden = True
End If
Next Col

End Sub

Reply
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
Find partial match from column A,B and fill partial match in C? Tacrier Excel Discussion (Misc queries) 4 October 24th 08 11:24 PM
Vlookup using a partial text match JGROVE Excel Worksheet Functions 1 August 15th 08 03:18 PM
Macro to hide column based on header name [email protected][_2_] Excel Programming 6 October 11th 06 10:09 PM
sumif based on partial match [email protected] Excel Worksheet Functions 2 April 4th 06 01:14 AM
macro to hide column based on header Todd[_6_] Excel Programming 6 September 4th 03 04:34 AM


All times are GMT +1. The time now is 11:02 PM.

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"