Need help on VB code

SKV

Active Member
Joined
Jan 7, 2009
Messages
257
Hi - I have to upload a lot of files in my system for some simulation. I am very new to VB code so looking for help.

1) I have 20 files in a folder and all named as Day1, day2, day3.... I need a VB code which upload these files 1 by 1 and also run some macros (mac1, mac2 etc) each time the new files is uploaded

2)In my current system, I use the Now() to record the day the file was uploaded. Since my simulation is based on this day. I want the above code to manipulate the date - It can have for day1 as Jan1, day Jan2 etc

Please guide
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi - I have to upload a lot of files in my system for some simulation. I am very new to VB code so looking for help.

1) I have 20 files in a folder and all named as Day1, day2, day3.... I need a VB code which upload these files 1 by 1 and also run some macros (mac1, mac2 etc) each time the new files is uploaded

2)In my current system, I use the Now() to record the day the file was uploaded. Since my simulation is based on this day. I want the above code to manipulate the date - It can have for day1 as Jan1, day Jan2 etc

Please guide

Please help immediately
 
Upvote 0
I presume that by 'upload' you mean 'import'.

If that is so, your tables will need to correspond with the structure of the text files. Given that your receiving structures are suitable you could use logic like:

Code:
For fileDay = 1 to 20
   Open filename for input as #33
   parse the input data and set fields into the table
   close file
Next
Now run your macros
HTH
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,850
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top