inserting rows and open file dialog

  • Thread starter Thread starter dannia
  • Start date Start date
D

dannia

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?
 
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top