Move an excel sheet into a new workbook and convert to a .txt file

AxMan

New Member
Joined
Apr 16, 2015
Messages
19
Hi all,

I'm trying to copy and paste cells A:D from a sheet into a new workbook and then in turn convert the new workbook into a .txt file, is there a good way to do this?

I have tried the below code but all it does is copy and paste cells A:D back into the same worksheet!

Sub Macro2()


x = ActiveWorkbook.Name


Sheets("Goods in").Select
Columns("A:D").Select
Selection.Copy

Workbooks.Add
Windows(x).Activate
Range("A1").Select
ActiveSheet.Paste
ActiveWorkbook.SaveAs


End Sub

Any help is appreciated.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Scratch that, I've managed to get the data to paste in the new workbook... just need to bring up the file->Save As window... is there an easy way to bring up the File Save As window?
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top