My post has posted out of order. Please see my last post #7.
Edit: or actually it is just as easy for me to add the code again
Just add the bit in red below
Sub SelectB2()
Dim LstRw As Long, sSaveAsFilePath As String, ws As Worksheet
Application.ScreenUpdating = False
With Sheets("MySheet")
LstRw = .Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row
.Range("B4:B" & LstRw).Copy
End With
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
ActiveSheet.Name = "NewSht"
Set ws = Sheets("NewSht")
sSaveAsFilePath = ThisWorkbook.Path
ActiveSheet.Copy
ActiveWorkbook.SaveAs sSaveAsFilePath & "\" & ws.Name & " " & Format$(Now, "dd-mm-yyyy hh.mm") & ".txt", xlTextWindows
If ActiveWorkbook.Name <> ThisWorkbook.Name Then
ActiveWorkbook.Close False
End If
Application.DisplayAlerts = False
ThisWorkbook.Sheets("NewSht").Delete
Application.DisplayAlerts = True
Sheets("MySheet").Activate
Application.ScreenUpdating = True
End Sub
I marked this thread as closed and started a new thread as per your advise, then how this thread is open?
You can still post in a thread marked solved (its done that way deliberately), the "Solved" is just an indication to others to save them looking at posts. Threads can only be locked/deleted/closed by a moderator or Admin.
Bookmarks