Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a column of PO numbers all containing 9 digits, like 605031101.
The sixth and seventh digits, in the example "11", represents the month, Nov. I want to hide all rows that do "not" contain 11, 10 or 09, Nov, Oct and Sep. How? TIA |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this bit of code:
It assumes the cell pointer is on the first cell and the end sell is blank. The months are hard codes but you could change this with a little form. Option Explicit Sub Hiderow() Dim cur_row As Long Dim cur_col As Long cur_row = ActiveCell.Row cur_col = ActiveCell.Column While Cells(cur_row, cur_col) < "" Select Case Mid(Cells(cur_row, cur_col), 6, 2) Case 9 To 11 ' ok do nothing Case Else Rows(cur_row).Hidden = True End Select If cur_row = 65536 Then Exit Sub cur_row = cur_row + 1 Wend End Sub "GregR" wrote: I have a column of PO numbers all containing 9 digits, like 605031101. The sixth and seventh digits, in the example "11", represents the month, Nov. I want to hide all rows that do "not" contain 11, 10 or 09, Nov, Oct and Sep. How? TIA |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Martin, thank you very much.
Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Chg 1 "Last, First Mid" column to 3 "First", "Middle", "Last" colu | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Hide a column "if"? | Excel Discussion (Misc queries) | |||
How do I change the column heading in Excel to display "A" "B" "C | New Users to Excel | |||
How do I split "A1B2" into "A1" and "B2" using text to column fun. | Excel Programming |