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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
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,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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