I have the following vba code that would take a column and export it to a txt. However when it runs, the formulas in the exported txt show as #REF!
I did a quick macro manually doing what I wanted and noticed the Paste was not a PasteSpecial. I added this and it still did not work, unless I have it in wrong.
thank you!
I did a quick macro manually doing what I wanted and noticed the Paste was not a PasteSpecial. I added this and it still did not work, unless I have it in wrong.
thank you!
VBA Code:
Sub EXPORT()
Sheets("Sheet2").Cells(Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row - 22, "A").Resize(23).Value = Sheets("Sheet3").Range("W19:W43").Value
Dim wb As Workbook
Dim saveFile As String
Dim WorkRng As Range
On Error Resume Next
Set WorkRng = Sheets("Sheet2").Range("AA1:AA24635")
Application.ScreenUpdating = True
Application.DisplayAlerts = False
Set wb = Application.Workbooks.Add
WorkRng.Copy
wb.Worksheets(1).Paste
'wb.Wroksheets(1).Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
saveFile = Application.GetSaveAsFilename(FileFilter:="Text Files (*.txt), *.txt")
wb.SaveAs Filename:=saveFile, FileFormat:=xlTextPrinter, CreateBackup:=False
wb.Close
Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = False
End Sub