Importing tab delimited files and clearing large ranges

Wray Sisk commented on Importing text files with VBA – 3, asking if it could be modified to read tab delimited files.

It could be, and has been; download here: Text-in2.ZIP

It turned out to be a simple task; just the addition of one line to the splittext() function:

 If LCase(Separator) = “tab” Then Separator = Chr(9)

To allow the use of other non displaying characters, and also so the code for tab (9) could be used instead of “tab” I also added:

If Val(Separator) > 0 Then Separator = Chr(CLng(Separator))

and changed the data type of separator from string to variant.

Whilst changing the spreadsheet I noticed that I had commented in the post about the very slow performance of Excel 2007 in clearing large ranges.  There is a solution to this one, the slow down is associated with the Google Desktop COM add-in,  and if you de-activate this the problem goes away.  More details from Charles Williams here: Google Toolbar Slows Excel

Advertisements
This entry was posted in Excel, UDFs, VBA and tagged , , , , , . Bookmark the permalink.

2 Responses to Importing tab delimited files and clearing large ranges

  1. Pingback: Daily Download 32: Text functions | Newton Excel Bach, not (just) an Excel Blog

  2. Pingback: Importing Text Files; Unix Format | Newton Excel Bach, not (just) an Excel Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s