我有一个工作表在列E中有一个服务日期。我一直在尝试将所有不是一个月的第一行的行分成一个单独的工作表,并保留所有行的日期落在一个月的第一天。
我已经能够找到类似问题的解决方案,但我不太了解VBA所以适应我发现的解决方案到目前为止是一项不可逾越的任务。
这是一项相当简单的任务,但是随着最近这张表所跟踪的增长,手动操作已经变得非常耗时。一种自动化将本月第一天完成的事情与非事物分离的方法非常有用。
答案 0 :(得分:1)
You can do this very fast even with a manual procedcure, e.g.
=DAY([servicedate])
答案 1 :(得分:0)
If you column of dates starts in cell E1, you can enter this formula into cell F1 and all the cells below.
=IF(MONTH($E1-1)<>MONTH($E1),"1st Of Month","")
By subtracting 1 from a date you get the date of the the previous day. The IF statement therefore compares the month of the previous day with the month of today.
You could use a similar technique in VBA, but I suspect you might not need to.
Once you have a value in the column you can use the "Autofilter" functionality to only show the 1st of the month rows. highlight all the rows and paste into another sheet and only the visible rows will be pasted in.
Ok?
Harvey