Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Macro to open folder and let you chose file, then continue import

Hi:
I am trying to create a macro that when run will open a particular folder,
let you select the text file, than import it. I have gotten the marco done
that opens the folder, however once I choose the file I am not sure how to
proceed. Right now I do it manually, when I import it I use the text import
wizard and chose "Fixed width", start the import at line 9, move the lines so
that they are in the proper place, then import it into excel. Once in excel
I remove all the empty rows, which is every other row. Can I accomplish all
this with either 1 or 2 macros. If so, any ideas on how?
Thanks a lot for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro to open folder and let you chose file, then continue import

Record a macro when you open that text file manually. You'll see all the
details that you need for parsing your data.

And maybe you can sort your range so all the empty cells go to the bottom?

or...

Can you pick out a column that always has data in it if that row is used? I
used column X for my sample code:

On error resume next
activesheet.range("x:x").cells.specialcells(xlcell typeblanks).entirerow.delete
on error goto 0

rascal wrote:

Hi:
I am trying to create a macro that when run will open a particular folder,
let you select the text file, than import it. I have gotten the marco done
that opens the folder, however once I choose the file I am not sure how to
proceed. Right now I do it manually, when I import it I use the text import
wizard and chose "Fixed width", start the import at line 9, move the lines so
that they are in the proper place, then import it into excel. Once in excel
I remove all the empty rows, which is every other row. Can I accomplish all
this with either 1 or 2 macros. If so, any ideas on how?
Thanks a lot for any help.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 145
Default Macro to open folder and let you chose file, then continue import

Start by recording a macro while you open the text file: edit that so it
will accept a filepath selected by the user using
Application.GetOpenFilename().

Tim

"rascal" wrote in message
...
Hi:
I am trying to create a macro that when run will open a particular folder,
let you select the text file, than import it. I have gotten the marco
done
that opens the folder, however once I choose the file I am not sure how to
proceed. Right now I do it manually, when I import it I use the text
import
wizard and chose "Fixed width", start the import at line 9, move the lines
so
that they are in the proper place, then import it into excel. Once in
excel
I remove all the empty rows, which is every other row. Can I accomplish
all
this with either 1 or 2 macros. If so, any ideas on how?
Thanks a lot for any help.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to open most current file in folder Tasha Excel Discussion (Misc queries) 6 June 19th 07 03:36 PM
Macro syntax to open file in current explorer folder [email protected] Excel Discussion (Misc queries) 4 January 11th 06 12:07 PM
Macro syntax to open file in current explorer folder [email protected] Excel Programming 4 January 11th 06 12:07 PM
using macro to open every file in a folder wraithlead[_8_] Excel Programming 0 October 27th 04 08:07 AM
using macro to open every file in a folder wraithlead[_7_] Excel Programming 1 October 27th 04 07:19 AM


All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"