title image


Smiley Re: Tabellenzelleneintrag xxx-xxxxx-xxx in drei Spalten aufsplitten?
Hallo,



so geht es (bei mir).

Attribute VB_Name = "modSplitTabelle"

Sub SplitTabelle()

If ActiveDocument.Tables.Count = 1 Then

Dim myRange As Range

'

For i = 1 To ActiveDocument.Tables(1).Rows.Count

Dim sText, sToSplit, sToInsert

Set myRange = ActiveDocument.Tables(1).Columns(2).Cells(i).Range

myRange.Select

sText = Left(myRange.Text, Len(myRange.Text) - 2)

' MsgBox sText

sToSplit = Split(sText, "-")

sToInsert = sToSplit(0) & ";" & sToSplit(1) & ";" & sToSplit(2)

' MsgBox sToInsert

myRange.Text = sToInsert

Next i

End If

'

ActiveDocument.Tables(1).Select

Selection.Rows.ConvertToText Separator:=wdSeparateByCommas, _

NestedTables:=True

Selection.ConvertToTable Separator:=wdSeparateByCommas, NumColumns:=5, _

NumRows:=5, AutoFitBehavior:=wdAutoFitContent

Selection.Collapse

End Sub      Hubert





geschrieben von

Anhang
Bild 10898 zu Artikel 519896

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: