从一行创建三行数据 [英] Create three rows of data from one row

查看:89
本文介绍了从一行创建三行数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我对VBA不太熟悉,但对Excel中的公式有一定的熟悉。  话虽这么说,我想我需要代码来完成我想要做的事情,而不仅仅是一个公式。

I'm not very familiar with VBA, but moderately familiar with Formulas in Excel.  That being said, I think I'll need code to accomplish what I'm trying to do, rather than just a Formula.

我有一个如下所示的电子表格:

I have a spreadsheet that looks like this:

姓名 公司
电话号码 电子邮件

Chris IRL Holdings
11111111111 ChrisEmail @ fake汤姆 IRL Holdings
22222222222 TomEmail@fake.com

Steve IRL Holdings
33333333333 SteveEmail@fake.com

Joe < span style ="white-space:pre"> IRL Holdings
44444444444 JoeEmail@fake.com

Matt IRL Holdings < span style ="white-space:pre">
55555555555 MattEmail@fake.com

Name Company Phone Number Email
Chris IRL Holdings 11111111111 ChrisEmail@fake.com
Tom IRL Holdings 22222222222 TomEmail@fake.com
Steve IRL Holdings 33333333333 SteveEmail@fake.com
Joe IRL Holdings 44444444444 JoeEmail@fake.com
Matt IRL Holdings 55555555555 MattEmail@fake.com

现在,我需要的是在这四列的右侧添加另一列,并为每个原始行创建四个新行,看起来像这样(换句话说,如果有办法从中获取数据列表列或者复制到剪贴板
所以我可以把它放到一个文本文件中,或者单独导出到一个文本文件,这样可以工作):

Now, what I need is something that will add another column to the right of those four columns, and create four new rows per one original row, to look like so (alternately, if there's a way to just have the data from the List column either copy to the clipboard so I can drop it into a text file, OR export to a text file on its own, that would work):

姓名 公司
电话号码 电子邮件
列表

Chris IRL H. oldings
11111111111 ChrisEmail@fake.com
Chris

Tom IRL Holdings
22222222222 TomEmail@fake.com
IRL Holdings

Steve IRL Holdings
33333333333 SteveEmail@fake.com  &NBSP; &NBSP;   11111111111

Joe IRL Holdings
44444444444 JoeEmail@fake.com
ChrisEmail@fake.com

Matt IRL Holdings
55555555555 MattEmail@fake.com
Tom

IRL Holdings

22222222222

TomEmail@fake.com

Steve

IRL Holdings

33333333333

SteveEmail@fake.com

Joe

IRL H. oldings

44444444444

JoeEmail@fake.com

马特

IRL Holdings

55555555555

MattEmail@fake.com

Name Company Phone Number Email List
Chris IRL Holdings 11111111111 ChrisEmail@fake.com Chris
Tom IRL Holdings 22222222222 TomEmail@fake.com IRL Holdings
Steve IRL Holdings 33333333333 SteveEmail@fake.com        11111111111
Joe IRL Holdings 44444444444 JoeEmail@fake.com ChrisEmail@fake.com
Matt IRL Holdings 55555555555 MattEmail@fake.com Tom
IRL Holdings
22222222222
TomEmail@fake.com
Steve
IRL Holdings
33333333333
SteveEmail@fake.com
Joe
IRL Holdings
44444444444
JoeEmail@fake.com
Matt
IRL Holdings
55555555555
MattEmail@fake.com

基本上,我需要一种能够将联系人放入A到D列的方法,然后拥有Matt的所有四个单元格数据显示在另一个之下,而不是彼此相邻。  它需要在联系人到达
结束时停止运行,但仍然能够运行多达50,000个联系人。  即使联系人缺少其中一个数据,如电话号码或公司,也需要运行。

Essentially, I need a way to be able to put contacts into columns A through D, and then have, say, all four cells of Matt's data appear one below the other, instead of one beside each other.  It would need to stop running when it reaches the end of the contacts, but still be able to run through up to 50,000 contacts.  It would also need to run even if the contact is missing one of the pieces of data, like their phone number or their company.

如果有人有任何建议,那就太棒了!

If anyone has any advice, that would be great!

谢谢!

推荐答案

该网站不会让我回去正确格式化表格,因此对于我引用的第一个表格,假设数据位于5x5表格中,其中"Name","Company"等作为标题和"Chris","Matt"等。作为联系人
我稍后会参考。  对于我引用的第二个表,想象一下我们开始使用的5x5表,但是另外还有一个名为"List"的第6列表。只有在
List列中各自列出的值(名称,公司,电话号码等),一列在另一列的正下方。
The site won't let me go back and format the tables correctly, so for the first table I reference, imagine the data is in a 5x5 table with "Name", "Company", etc. as the headers and "Chris", "Matt", etc. as the contacts I reference later.  For the second table I reference, just imagine the 5x5 table we started with, but with an additional 6th column called "List" that just has the values (name, company, phone number, etc.) each listed on their own row in the List column, one right below the other.


这篇关于从一行创建三行数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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