Macro to copy paste data from notepad to excel

harshab6

Active Member
Joined
Oct 1, 2008
Messages
254
Hi,
I was using following Macro to Extract the data from different Excel workbooks and copy in a single Workbook.

sub Mergeworkbook()
Z = Application.GetOpenFilename(MultiSelect:=True)
'Open loop for action to be taken on all selected workbooks.
For x = 1 To UBound(Z)
Set WB = Workbooks.Open(Z(x))
WB.Sheets.Copy Before:=ThisWorkbook.Sheets(1)
WB.Close False
Next x
End Sub

This works fine with excel sheets but it fails in notepad.I want to extract the raw data(when I say Raw data means only Raw data that is copy data from note pad and paste it in excel no formatting stuff like text to columns to be involved ) from note pad and copy paste in excel.I am not sure where and how the changes in above code should be made in order to make this work it would be great if anyone could give me a appropriate solution on this.I have been Trying to do this from 3 days but Desperately failed.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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