简体   繁体   English

Excel-仅显示具有特定月份和年份的列

[英]Excel - display only columns with specific month and year

Need help! 需要帮忙!

I have put into row 6 in Excel dates starting from 1st November, 2016 (Cell F6) to 31st December, 2017 (Cell PO6). 我将Excel日期从2016年11月1日(单元格F6)开始到2017年12月31日(单元格PO6)的第6行。 Cell B1 shows drop down list of months and cell B2 shows years. 单元格B1显示月份的下拉列表,单元格B2显示年份。

I need a tip on how to set formula which will allow me to show only columns of month and year which are chosen in cells B1 and B2. 我需要有关如何设置公式的提示,该公式将允许我仅显示在单元格B1和B2中选择的月份和年份列。 For Example, if i choose November 2016, only columns F:AI will be visible, while columns AJ:PO will be hidden. 例如,如果我选择2016年11月,则只有F:AI列可见,而AJ:PO列则隐藏。

Please provide suggestions on how can this formula be formatted in different way, if you have suggestions. 如果有建议,请提供有关如何以不同方式设置此公式格式的建议。

You should write a VBA code combining if...then with 您应该编写一个VBA代码,如果...

Worksheets("Sheet1").Columns("C").Hidden = True

The if...then guide is here and the hide column guide is here . if ... then指南在这里 ,hide column指南在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM