Prøv at flytte din kolonne til et tomt ark i kolonne A
Kør denne makro:
Sub MedInfo()
Range("C1").Select
MsgBox "Først opdeles ord"
Columns("A:A").TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=True, Other:=False
SidsteKolonne = Cells.Find(What:="*", SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
SidsteKolonneBogstav = Left(Cells(1, SidsteKolonne).Address(1, 0), _
InStr(1, Cells(1, SidsteKolonne).Address(1, 0), "$") - 1)
MsgBox "Sidste brugte kolonne er lokaliseret til: " & SidsteKolonne & vbCrLf & _
"Tallet skiftes ud med bogstavet: " & SidsteKolonneBogstav
Range("C1").Select
For i = 3 To SidsteKolonne
KolonneBogstav = Left(Cells(1, i).Address(1, 0), _
InStr(1, Cells(1, i).Address(1, 0), "$") - 1)
MsgBox "Duplikater fjernes i kolonne: " & KolonneBogstav
slut = Range(KolonneBogstav & "65536").End(xlUp).Address
Range(KolonneBogstav & "1:" & slut).RemoveDuplicates Columns:=1, Header:=xlNo
Range(KolonneBogstav & "1").Offset(0, 1).Select
Next i
Range("D1").Select
For i = 4 To SidsteKolonne
KolonneBogstav = Left(Cells(1, i).Address(1, 0), _
InStr(1, Cells(1, i).Address(1, 0), "$") - 1)
MsgBox "Nu flyttes kolonne: " & KolonneBogstav & " til en, i kolonne C"
slut = Range(KolonneBogstav & "65536").End(xlUp).Address
Range(KolonneBogstav & "1:" & slut).Cut
Range("C65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Range(KolonneBogstav & "1").Offset(0, 1).Select
Next i
Range("C1").Select
MsgBox "Tomme celler fjernes i kolonne: C"
Range("C1" & ":" & Range("C65536").End(xlUp).Address).SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
MsgBox "Duplikater fjernes i kolonne: C"
Range("C:C").RemoveDuplicates Columns:=1, Header:=xlNo
Range("A1").Select
End Sub
Hvis det virke, så brug denne:
Sub UdenInfo()
Application.ScreenUpdating = False
Columns("A:A").TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=True, Other:=False
SidsteKolonne = Cells.Find(What:="*", SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
SidsteKolonneBogstav = Left(Cells(1, SidsteKolonne).Address(1, 0), _
InStr(1, Cells(1, SidsteKolonne).Address(1, 0), "$") - 1)
For i = 3 To SidsteKolonne
KolonneBogstav = Left(Cells(1, i).Address(1, 0), _
InStr(1, Cells(1, i).Address(1, 0), "$") - 1)
slut = Range(KolonneBogstav & "65536").End(xlUp).Address
Range(KolonneBogstav & "1:" & slut).RemoveDuplicates Columns:=1, Header:=xlNo
Range(KolonneBogstav & "1").Offset(0, 1).Select
Next i
For i = 4 To SidsteKolonne
KolonneBogstav = Left(Cells(1, i).Address(1, 0), _
InStr(1, Cells(1, i).Address(1, 0), "$") - 1)
slut = Range(KolonneBogstav & "65536").End(xlUp).Address
Range(KolonneBogstav & "1:" & slut).Cut
Range("C65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Next i
Range("C1" & ":" & Range("C65536").End(xlUp).Address).SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
Range("C:C").RemoveDuplicates Columns:=1, Header:=xlNo
Range("C1").Select
Application.ScreenUpdating = True
End Sub