Public Sub Omdan() Dim Data As Variant, Udstring As String, Antal As Integer, I As Integer, Celle As Variant Data = Selection
Set Data = Application.InputBox( _ prompt:="Vælg data", Type:=8) Set Celle = Application.InputBox( _ prompt:="Vælg output celle", Type:=8) Antal = Data.Cells.Count I = 1 For Each C In Data.Cells Udstring = Udstring & Data(I, 1) If I < Antal Then Udstring = Udstring & ";" I = I + 1 Next
Public Sub Omdan() Dim Data As Range, Udstring As String, Antal As Integer, I As Integer, Celle As Variant, C As Range
Set Data = Application.InputBox( _ prompt:="Vælg data", Type:=8) Set Celle = Application.InputBox( _ prompt:="Vælg output celle", Type:=8) Antal = Data.Cells.Count I = 1 For Each C In Data.Cells Udstring = Udstring & Data(I, 1) If I < Antal Then Udstring = Udstring & ";" I = I + 1 Next Range(Celle.Address) = Udstring End Sub
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.