重新排列某些列和行 [英] Rearrange certain columns and rows

查看:180
本文介绍了重新排列某些列和行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个格式如下的Excel电子表格:

I have an Excel spreadsheet formatted like this:

我一直在努力做的是将其格式化为:

What I have been trying to do is format it to look like this:

< img src =https://i.stack.imgur.com/qw0nC.pngalt =之后>

所以它是一种转置我猜(不是确定如何调用它)。

So it's kind of transposed I guess (not sure how to call it).

我已经花了最后一个半小时尝试在VBA中做到这一点,没有成功。

I've spent the last hour and a half trying to do it in VBA with no success.

这只是一个如何格式化的示例,实际上大约有5万个,所以我需要使用VBA或类似的东西。

This is just a sample of how it is formatted, in reality there's about 50,000 of these, so I need to do it using VBA or something of the sort.

有人能够帮助我解决这个问题吗?

Would someone be able to help me out with how to do this?

推荐答案

使用Excel 2007,不一定需要VBA。在数据透视表向导(Alt + D,P)中选择多个合并范围,接下来,选择我将创建页面字段,接下来,选择您的数据,接下来,选择新建工作表。双击数据透视表的底部RH单元格。在ColumnA上过滤并删除空白行,在ColumnB上进行过滤,并删除包含Type的行。在Row和Column右侧插入列,并填充查找值。

With Excel 2007 you don’t necessarily need VBA. In Pivot Table Wizard (Alt+D, P) select ‘Multiple consolidation ranges’, Next, select ‘I will create the page fields’, Next, select your data, Next, select ‘New worksheet’, Finish. Double click on bottom RH cell of pivot table. Filter on ColumnA and delete blank rows, filter on ColumnB and delete rows containing "Type". Insert columns to the right of "Row" and "Column" and fill with lookup values.

这篇关于重新排列某些列和行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆