AW: Zeilen durchsuchen und in neue Arebitsmappe einfüg
28.09.2003 14:12:46
Beni
Hallo Holger,
ich habe dir etwas gebastelt und ein Beispiel angehängt.
Ein Teil deiner Beschreibung ("nach buchstabe in spalte (a:xx) in die")verstehe ich nicht, den musst Du noch näher umschreiben.
Gruss Beni
https://www.herber.de/bbs/user/1193.xls
Sub Blattspeichern()
'28.09.2003 von Bernhard Mächler
Dim sPath As String, sWks As String, sFile As String
sPath = ActiveWorkbook.Path & "\"
Dim Default
sWks = "Test"
If sWks = "" Then Exit Sub
Titel = "InputBox"
Mldg = "Buchstabe eingeben"
B = InputBox(Mldg, Titel)
If B = "" Then Exit Sub
[A1].Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
[A:A].Select
Cells.Find(What:=B, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False).Select
Titel = "InputBox"
Mldg = "Dateiname eingeben"
sFile = InputBox(Mldg, Titel)
prompt = "Blattname"
If sFile = "" Then Exit Sub
i = 1
nochmal:
If ActiveCell.Offset = ActiveCell.Offset(i, 0) Then
i = i + 1
ActiveCell.Range("A1:G" & i).Copy
GoTo nochmal
End If
Workbooks.Add
ActiveSheet.Paste
ActiveCell.Select
ActiveSheet.Name = sWks
ActiveWorkbook.SaveAs sPath & sFile
End Sub