I give up. I've searched, I've hunted through SO, I've seen any number of deeply confusing three-page code segments to go through, and frankly while I'm sure they're all good solutions the code is just beyond me.
I have a bunch of data sheets, identical in structure but with lots of different data in them. They're all being stored in the same directory, and I'm trying to make a macro to cycle through them.
This was my original attempt (where RunImport
is the function that copies over all those data fields). It doesn't work.
Private Sub But_BatchRun_Click()
Dim sImpFolder As String, wb As Workbook
sImpFolder = GetFolder
For Each wb In sImpFolder
call runimport (wb)
Next wb
End Sub
Is there any easy and short way to do this that doesn't involve eight pages of code?