Hello everyone,
I am pretty new to this whole Excel VBA, Macro business. I have a relatively large spreadsheet (couple hundred columns) and I am trying to make it easier to navigate / select what I am viewing. I am using Excel 2007 if that is important.
This spreadsheet keeps track of contract information with a customer. Every once and a while the information changes. When this occurs the new information is dubbed Change 1,2,3,etc. In my spreadsheet the "Change #" is entered in Row 6 with the new information underneath of it. What I want my VBA code/Macro to do is only show the columns that equal the text selected from a Drop Down (in cell B5) menu created using Data Validation of Row 6. So if the Drop Down selection equals a value in Row 6, I want to keep that column visible, but other columns not visible. If the Drop Down selection is blank or """" then hide nothing.
The part where it gets trickier, is that each Change requires two column entries. So when I want to show the information for one change based on the Drop Down selection, I actually want that Column PLUS the Column to the right of it.
If I need to clarify/re-word anything please let me know. I am experienced with programming, just not in VBA so I am not sure how to setup what I want to do. Any help would be appreciated!
Dan
I am pretty new to this whole Excel VBA, Macro business. I have a relatively large spreadsheet (couple hundred columns) and I am trying to make it easier to navigate / select what I am viewing. I am using Excel 2007 if that is important.
This spreadsheet keeps track of contract information with a customer. Every once and a while the information changes. When this occurs the new information is dubbed Change 1,2,3,etc. In my spreadsheet the "Change #" is entered in Row 6 with the new information underneath of it. What I want my VBA code/Macro to do is only show the columns that equal the text selected from a Drop Down (in cell B5) menu created using Data Validation of Row 6. So if the Drop Down selection equals a value in Row 6, I want to keep that column visible, but other columns not visible. If the Drop Down selection is blank or """" then hide nothing.
The part where it gets trickier, is that each Change requires two column entries. So when I want to show the information for one change based on the Drop Down selection, I actually want that Column PLUS the Column to the right of it.
If I need to clarify/re-word anything please let me know. I am experienced with programming, just not in VBA so I am not sure how to setup what I want to do. Any help would be appreciated!
Dan
Code:
<table border="0" cellpadding="0" cellspacing="0" width="1216"><col style="width:48pt" span="19" width="64"> <tbody><tr style="height:15.0pt" height="20"> <td style="height:15.0pt;width:48pt" height="20" width="64">Change 1</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <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:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td>
</td> <td>Change 1</td> <td>
</td> <td>Change 2</td> <td>
</td> <td>Change 3</td> <td>
</td> <td> Change 4</td> <td>
</td> <td>Total</td> <td>Change 1</td> <td>
</td> <td> Change 2</td> <td>
</td> <td>Change 3</td> <td>
</td> <td>Change 4</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" align="right" height="20">1</td> <td>
</td> <td>a</td> <td>a</td> <td>a</td> <td>a</td> <td>a</td> <td>a</td> <td>a</td> <td>a</td> <td>4a</td> <td>a</td> <td>a</td> <td>a</td> <td>a</td> <td>a</td> <td>a</td> <td>a</td> <td>a</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" align="right" height="20">2</td> <td>
</td> <td>b</td> <td>b</td> <td>b</td> <td>b</td> <td>b</td> <td>b</td> <td>b</td> <td>b</td> <td>4b</td> <td>b</td> <td>b</td> <td>b</td> <td>b</td> <td>b</td> <td>b</td> <td>b</td> <td>b</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" align="right" height="20">3</td> <td>
</td> <td>c</td> <td>c</td> <td>c</td> <td>c</td> <td>c</td> <td>c</td> <td>c</td> <td>c</td> <td>4c</td> <td>c</td> <td>c</td> <td>c</td> <td>c</td> <td>c</td> <td>c</td> <td>c</td> <td>c</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" align="right" height="20">4</td> <td>
</td> <td>d</td> <td>d</td> <td>d</td> <td>d</td> <td>d</td> <td>d</td> <td>d</td> <td>d</td> <td>4d</td> <td>d</td> <td>d</td> <td>d</td> <td>d</td> <td>d</td> <td>d</td> <td>d</td> <td>d</td> </tr> </tbody></table>
Last edited: