excel - Select multiple folders - VBA -


i'm using macro merge csv files one. macro working good, have 1 block, allows select folder csv files merge.

two questions:

  1. can choose more 1 folder merge? (in 1 folder have lot of csv files.).
  2. how can choose other initial directory choose folders? need use folders server.

code block:

'browse folder csv files set oapp = createobject("shell.application") set ofolder = oapp.browseforfolder(0, "select folder csv files", 512) if not ofolder nothing     foldername = ofolder.self.path     if right(foldername, 1) <> "\"         foldername = foldername & "\"     end if 

now availability choose 1 folder from:

not enough choice

i love choose more this:

more choice

selecting multiple folders not possible @ all. selecting two folders @ same time not work.

you can select …

here how select one folder:

public sub selectfolder()     dim fdl filedialog      set fdl = application.filedialog(msofiledialogfolderpicker)     fdl         .initialfilename = "c:\temp" 'where start choosing folder         if .show <> -1             msgbox "canceled" 'nothing selected         else             debug.print .selecteditems(1) 'the selected folder         end if     end end sub 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -