根据标准连接列中的单元格

我正在寻找连接列中的单元格。 模型开始时没有任何型号. 该模型的选项开始于. 我希望marco一直连接到下一个型号(下一个没有开头的单元格)的开头,然后重复这个过程,我在下面提供了一个例子。 任何帮助将不胜感激!

当前状态

 abc .bcr .kjl .plk ghy .ytr .ihgew .rth .u .lpn trh .pjkjh .dsgyudd .hg .gfd 

未来的状态

 abc.bcr.kjl.plk ghy.ytr.ihgew.rth.u.lp trh.pjkjh.dsgyudd.hg.gfd 

尝试这个:

 Option Explicit Sub ConditionalConcatenate() 'col A contain the texts and col B in corresponding row hold concatenated result Dim strDone As String Dim rngg As Range, lastcolA As Range, rngused As Range Dim counted As Integer, i As Integer, j As Integer Range("B:B").ClearContents strDone = "" Set rngg = ActiveSheet.Range("A:A") Set lastcolA = rngg.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious) Set rngused = Range("A1:A" & lastcolA.Row) counted = rngused.Rows.Count For i = 1 To counted If Left(rngused(i), 1) <> "." Then strDone = strDone & rngused(i) For j = 1 To counted If Left(rngused(i).Offset(j, 0), 1) = "." Then strDone = strDone & rngused(i).Offset(j, 0) ElseIf Left(rngused(i).Offset(j, 0), 1) <> "." Then Range("B" & i).Value = strDone strDone = "" Exit For End If Next End If Next Set rngg = Nothing Set lastcolA = Nothing Set rngused = Nothing End Sub