Import textfile to first free cell in row and use right formating

SalK

New Member
Joined
Oct 2, 2009
Messages
2
Hello

Hopefully you can help me with this. I have tried several VBA modules made by others but I havent got it 100% right yet. Here is what I want to do.

I want to import a textfile into a sheet that already contains a lot of info.

I want to find the last cell in A row and there import my textfile.

It also needs to use the right format since the textfile data is separated with tabs.

It also needs to be sorted by the data in the first row.

The data in the textfile will have different numbers of rows but not collumns.

Thanks in advance! /SalK
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Welcome to the Board!

Check out this link here for finding the last row (if you do a Search, you will come across tons of posts that deal with this question):
http://www.mrexcel.com/forum/showthread.php?t=408192&highlight=find+row

A useful thing to select a whole block of data when you don't know the size of it is to use Current Region, which will select all contiguous rows and columns from a determined starting point, i.e.
Range("A10").CurrentRegion.Select

Most of the other code that you will need you can get by using the Macro Recorder and record yourself recording the steps you want to complete.
 
Upvote 0
Thanks for the help.

CurrentRegion.Select was useful and I inserted a blank row between imports and in that way I could use your tips.

/SalK
 
Upvote 0

Forum statistics

Threads
1,214,792
Messages
6,121,612
Members
449,038
Latest member
apwr

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