Hello
Need help to hide merge column and show all the column below the day merge. I've the following code but is only showing a single column.
Can someone help ......
Sub Hide()
Dim c As Range, rng
myday = Application.InputBox("Enter a Day", Title:="Hide Column")
If myday = False Then
Exit Sub
Else
If myday = "" Then
MsgBox ("No day input")
Exit Sub
End If
Continue:
Set rng = Range("e8:AZ8")
For Each c In rng
c.EntireColumn.Hidden = (UCase(CStr(c.Value)) <> UCase(myday))
Next c
Range("A1").Select
End If
End Sub
-------------------------
Below is my worksheet. I want to show all the column under the merge cell when i select the day. (i.e Date/Purpose/Time/Used By)
<table style="padding-right: 2pt; padding-left: 2pt; font-size: 10pt; font-family: Calibri,Arial; background-color: rgb(255, 255, 255);" border="1" cellpadding="0" cellspacing="0"> <colgroup> <col style="font-weight: bold; width: 30px;"> <col style="width: 27px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"></colgroup> <tbody> <tr style="font-weight: bold; font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;"> <td> </td> <td>B</td> <td>C</td> <td>D</td> <td>E</td> <td>F</td> <td>G</td> <td>H</td> <td>I</td> <td>J</td> <td>K</td> <td>L</td> <td>M</td> <td>N</td> <td>O</td> <td>P</td> <td>Q</td> <td>R</td> <td>S</td> <td>T</td> <td>U</td> <td>V</td> <td>W</td> <td>X</td> <td>Y</td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">2</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 34px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">3</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Mon</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Tue</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Wed</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Thu</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Fri</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Sat</td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">4</td> <td style="font-weight: bold; font-size: 8pt; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">5</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">6</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">7</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">8</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">9</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">10</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr></tbody></table>
Cheers
Need help to hide merge column and show all the column below the day merge. I've the following code but is only showing a single column.
Can someone help ......
Sub Hide()
Dim c As Range, rng
myday = Application.InputBox("Enter a Day", Title:="Hide Column")
If myday = False Then
Exit Sub
Else
If myday = "" Then
MsgBox ("No day input")
Exit Sub
End If
Continue:
Set rng = Range("e8:AZ8")
For Each c In rng
c.EntireColumn.Hidden = (UCase(CStr(c.Value)) <> UCase(myday))
Next c
Range("A1").Select
End If
End Sub
-------------------------
Below is my worksheet. I want to show all the column under the merge cell when i select the day. (i.e Date/Purpose/Time/Used By)
<table style="padding-right: 2pt; padding-left: 2pt; font-size: 10pt; font-family: Calibri,Arial; background-color: rgb(255, 255, 255);" border="1" cellpadding="0" cellspacing="0"> <colgroup> <col style="font-weight: bold; width: 30px;"> <col style="width: 27px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"> <col style="width: 31px;"> <col style="width: 51px;"></colgroup> <tbody> <tr style="font-weight: bold; font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;"> <td> </td> <td>B</td> <td>C</td> <td>D</td> <td>E</td> <td>F</td> <td>G</td> <td>H</td> <td>I</td> <td>J</td> <td>K</td> <td>L</td> <td>M</td> <td>N</td> <td>O</td> <td>P</td> <td>Q</td> <td>R</td> <td>S</td> <td>T</td> <td>U</td> <td>V</td> <td>W</td> <td>X</td> <td>Y</td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">2</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 34px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">3</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Mon</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Tue</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Wed</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Thu</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Fri</td> <td style="font-weight: bold; font-size: 20pt; font-family: Arial Narrow; text-align: center;" colspan="4">Sat</td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">4</td> <td style="font-weight: bold; font-size: 8pt; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Date</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Purpose</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Time</td> <td style="font-weight: bold; font-family: Arial Narrow; text-align: center;">Used By</td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">5</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">6</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">7</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">8</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">9</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr> <tr style="height: 17px;"> <td style="font-size: 8pt; background-color: rgb(202, 202, 202); text-align: center;">10</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td></tr></tbody></table>
Cheers