Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default inserting rows and open file dialog

is there any way to create a macro that can open a file and then count
the number of rows within that file (a csv) insert that amount of rows
into an existing spreadsheet (where cell is selected) and then copy the
contents into those new rows?

one of the problems is that it is not a specific file, so is there a
way to have the open file window appear aswell?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default inserting rows and open file dialog

In XL 2002,

Application.FindFile

This will open a browse-for-file dialog and then open it in a new wb

or
fileToOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen < False Then
MsgBox "Open " & fileToOpen
End IfYou should then open the CSV file, which will open as a new workbook,
and use VBA to perform whatever actions you like on it!

--
|
+--Thief_
|


wrote in message
oups.com...
is there any way to create a macro that can open a file and then count
the number of rows within that file (a csv) insert that amount of rows
into an existing spreadsheet (where cell is selected) and then copy the
contents into those new rows?

one of the problems is that it is not a specific file, so is there a
way to have the open file window appear aswell?



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
Open Dialog Box to return Selected File Path and Not Open it. DMS Excel Programming 4 January 26th 10 12:46 PM
File open dialog box [email protected] Excel Discussion (Misc queries) 1 March 21st 07 03:01 AM
file open dialog sly020175 Excel Programming 1 January 13th 05 09:47 PM
File Open Dialog scantor145[_3_] Excel Programming 1 September 29th 04 12:04 AM
open file dialog-select file-import worksheet Divinedar Excel Programming 1 January 16th 04 07:13 PM


All times are GMT +1. The time now is 01:29 AM.

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"