从单元格中提取文本将其移入另一个工作表上的单元格中

你好,StackOver Flow的人,

我对VBA语言和工作stream程相当陌生,但我有一些编码经验。 我的题目并没有真正帮助解释的问题是:

我每天都会收到包含需要从中提取出来并移入相应单元格的信息的电子邮件。 电子邮件的例子如下,我已经从Outlook中复制到我已命名为“RawData”的Excel工作表中。 我将标签列为A)

**A)** Send Date 01/01/2014 Timestamp **B)** Subject ([Type]) word IndetifierOne IndetifierTwo word 100001 **C)** Body Item HYPERLINK (www.thistheexample.com/100001) Subitem Name HYPERLINK (www.thistheexample.com/name/99321)keyword **All this Information is irrelevant** Item Names HYPERLINK (www.thistheexample.com/name/99321)keyword HYPERLINK (www.thistheexample.com/name/99321)keyword HYPERLINK (www.thistheexample.com/name/99321)keyword 

什么需要提取和放置在列中的顺序是

 **A)** Date **B)** Identifier Two **C)** This has other information input into it later manually **D)** Identifier One **E)** keyword sometimes has more than one line in it separated by a , will vary often **F)** Timestamp **G)** (www.thistheexample.com/100001) this one needs to be a HYPERLINK, the part before the "/" is always the same the IdValue "100001" will change **H)** IdValue from (www.thistheexample.com/100001) which would be 100001 

重新迭代我需要帮助的是,我不确定如何将所有这些信息sorting并放置在另一个工作表的正确单元格上,我一直在整理StackOverFlow,Mr.Excel以寻求帮助和指导但与信息打了一堵墙。 我正在寻找build议或我可以操纵的工作,请做好工作,谢谢。 也尝试了许多不同的想法,但是没有一个能够完成我所需要的T,使这个任务大部分是自动化的。

感谢您的帮助和时间。

我并不总是理解你的描述,因为我不能确定你的解释是否是电子邮件的一部分,或者只是告诉我们它是什么。

如果电子邮件的结构相同,我不会使用VBA。 只是公式:

提取date:在工作表A1)

=原数据(原数据!A1,SEARCH(“”,RawData!A1,1)+ 1,LENGTH(原数据!A1)

这将从表单RawData单元格A1提取空间后的所有内容。 如果你的date格式总是一样的(比如“16/02/2014” – 10个字符),而不是确保没有其他东西被提取,你可以试试:= MIDDLE(RawData!A1,SEARCH(“”,RawData!A1,1 )+1,10)

如果你想使用VBA:中间选项是build立在:Date = Mid(Cells(1,1),5,10)

searchfunction可以被称为:SpacePlace = Application.WorksheetFunction.Search(“”,Cells(1,1),10)