insert formulas into column e,f,g across 800 csv files

i need to insert these formula into every workbook in 499 rows , putting them in column e,f,g,

=MID(b1,FIND("http",b1),IFERROR(FIND(" ",b1,FIND("http",b1))-1,LEN(b1))-FIND("http",b1)+1)
=MID(c1,FIND("http",c1),IFERROR(FIND(" ",c1,FIND("http",c1))-1,LEN(c1))-FIND("http",c1)+1)
=MID(d1,FIND("http",d1),IFERROR(FIND(" ",d1,FIND("http",d1))-1,LEN(d1))-FIND("http",d1)+1)

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saqib Husain, SyedEngineerCommented:
This code should open all excel files in the specified directory and paste the formula in the desired range

Sub copyformula()
Dim fnam As String
Dim fpath As String
Dim twb As Workbook
fpath = "C:\Documents and Settings\Administrator\My Documents\"
fnam = Dir(fpath & "*.xls*")
Do While fnam <> ""
    Set twb = Workbooks.Open(fpath & fnam)
    ActiveSheet.Range("E1:G499").FormulaR1C1 = "=MID(RC[-3],FIND(""http"",RC[-3]),IFERROR(FIND("" "",RC[-3],FIND(""http"",RC[-3]))-1,LEN(RC[-3]))-FIND(""http"",RC[-3])+1)"
    twb.Close True
    fnam = Dir
End Sub

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
finnstoneAuthor Commented:
brilliant thank you
finnstoneAuthor Commented:
it keeps breaking after only ten files

i think it loses its place?
finnstoneAuthor Commented:
ah never mind. some files were corrupted
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.