ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please help with do while (https://www.excelbanter.com/excel-programming/323381-please-help-do-while.html)

Alvin Hansen[_2_]

Please help with do while
 
Hi
I use this in a userform
Do While kur1 <= kur2


Set fso = CreateObject("scripting.filesystemobject")
On Error GoTo delfolder
fso.GetFolder ("c:\" & tt & tal & kur1)

'fso.deletefile "c:\" & tt & tal & kur1 & "\*.*"
fso.deletefolder "c:\" & tt & tal & kur1 & "\*.*"
kur1 = kur1 + 1
Loop
How can i get this to work with my do while easy to say exit sub on error
but there can be other folder der are somthing in so what shall i do here ??

Reagrds Alvin


Alvin Hansen[_2_]

Please help with do while
 
Wow I done it
Yes yes yes

Alvin


"Alvin Hansen" skrev:

Hi
I use this in a userform
Do While kur1 <= kur2


Set fso = CreateObject("scripting.filesystemobject")
On Error GoTo delfolder
fso.GetFolder ("c:\" & tt & tal & kur1)

'fso.deletefile "c:\" & tt & tal & kur1 & "\*.*"
fso.deletefolder "c:\" & tt & tal & kur1 & "\*.*"
kur1 = kur1 + 1
Loop
How can i get this to work with my do while easy to say exit sub on error
but there can be other folder der are somthing in so what shall i do here ??

Reagrds Alvin



All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com