String 让excel将拆分字符串放在一起
我试图让excel把一系列没有系统格式化的文本字符串放在一起,这样它们就可以在数据表上拆分成不同的行 我知道这可能已经在其他地方解决了,对此我很抱歉,但我正在努力描述这个问题,我不能在上面发布图片,但基本上它是String 让excel将拆分字符串放在一起,string,excel,text,split,String,Excel,Text,Split,我试图让excel把一系列没有系统格式化的文本字符串放在一起,这样它们就可以在数据表上拆分成不同的行 我知道这可能已经在其他地方解决了,对此我很抱歉,但我正在努力描述这个问题,我不能在上面发布图片,但基本上它是 列1,其中包含条目列表,以及 第2列,包含分布在2行或更多行上的文本字符串 是否可以编写某种公式或宏来检查第一列,然后将第二列中的所有条目缝合在一起,直到在第一列中找到新条目?我有一种感觉,它可能会使用一些循环的东西与索引函数,但我甚至不知道从哪里开始 谢谢, 迈克迈克,给我个机会
- 列1,其中包含条目列表,以及
- 第2列,包含分布在2行或更多行上的文本字符串
Sub appendValues()
'The sub is designed to loop through code and when ever there is a null value and column a it will take the value of what is in column B and appended to the row above it and delete the row.
Dim row As Integer
row = 1
'This code starts with row one but this can be changed at will.
Do Until ThisWorkbook.Sheets("sheet1").Cells(row, 2).Value = ""
'loop statement is designed to continue to Loop until there is a null value inside of you the value in the second column.
If ThisWorkbook.Sheets("sheet1").Cells(row, 1).Value = "" Then
ThisWorkbook.Sheets("sheet1").Cells(row - 1, 2).Value = ThisWorkbook.Sheets("sheet1").Cells(row - 1, 2).Value & ThisWorkbook.Sheets("sheet1").Cells(row, 2).Value
Rows(row).Delete
Else
'else statement is needed because there is an implied looping by decreasing the total number of rows after the delete.
row = row + 1
End If
Loop
End Sub
迈克为你做了这件事??还是你需要更多的帮助?