The following code works fine.
Kill FileNameZip2
Kill FileNameZip3
Would the following code do the same?
Kill FileNameZip2 & FileNameZip3
Thanks,
Paul
The following code works fine.
Kill FileNameZip2
Kill FileNameZip3
Would the following code do the same?
Kill FileNameZip2 & FileNameZip3
Thanks,
Paul
Have you try it ?
Answer is No
If you want to delete all files in a folder you can do this
On Error Resume Next
Kill "C:\folder\*.*"
--
Regards Ron de Bruin
http://www.rondebruin.nl
"PCLIVE" <[email protected]> wrote in message news:[email protected]...
> The following code works fine.
>
> Kill FileNameZip2
> Kill FileNameZip3
>
>
> Would the following code do the same?
>
> Kill FileNameZip2 & FileNameZip3
>
> Thanks,
> Paul
>
Ok Ron,
Here's what I got. I need to kill one or two files based on an if
statement. If L2 = "Jan", then I need to delete FileNameZip3. Else I need
to delete two files, FileNameZip2 and FileNameZip3. How would I do this?
If there is such thing as a block Else statement...
If Sheets("Setup").Range("L2").Value = "Jan" _
Then Kill FileNameZip3 _
Else Kill FileNameZip2
Kill FileNameZip3
Thanks,
Paul
"Ron de Bruin" <[email protected]> wrote in message
news:[email protected]...
> Have you try it ?
> Answer is No
>
> If you want to delete all files in a folder you can do this
>
> On Error Resume Next
> Kill "C:\folder\*.*"
>
>
>
>
> --
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
> "PCLIVE" <[email protected]> wrote in message
> news:[email protected]...
>> The following code works fine.
>>
>> Kill FileNameZip2
>> Kill FileNameZip3
>>
>>
>> Would the following code do the same?
>>
>> Kill FileNameZip2 & FileNameZip3
>>
>> Thanks,
>> Paul
>>
>
>
Try this
If Sheets("Setup").Range("L2").Value = "Jan" Then
Kill FileNameZip3
Else
Kill FileNameZip2
Kill FileNameZip3
End If
--
Regards Ron de Bruin
http://www.rondebruin.nl
"PCLIVE" <[email protected]> wrote in message news:%[email protected]...
> Ok Ron,
>
> Here's what I got. I need to kill one or two files based on an if statement. If L2 = "Jan", then I need to delete FileNameZip3.
> Else I need to delete two files, FileNameZip2 and FileNameZip3. How would I do this? If there is such thing as a block Else
> statement...
>
> If Sheets("Setup").Range("L2").Value = "Jan" _
> Then Kill FileNameZip3 _
> Else Kill FileNameZip2
> Kill FileNameZip3
>
> Thanks,
> Paul
>
> "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
>> Have you try it ?
>> Answer is No
>>
>> If you want to delete all files in a folder you can do this
>>
>> On Error Resume Next
>> Kill "C:\folder\*.*"
>>
>>
>>
>>
>> --
>> Regards Ron de Bruin
>> http://www.rondebruin.nl
>>
>>
>> "PCLIVE" <[email protected]> wrote in message news:[email protected]...
>>> The following code works fine.
>>>
>>> Kill FileNameZip2
>>> Kill FileNameZip3
>>>
>>>
>>> Would the following code do the same?
>>>
>>> Kill FileNameZip2 & FileNameZip3
>>>
>>> Thanks,
>>> Paul
>>>
>>
>>
>
>
That's it. Pretty simple, but my brain wasn't functioning.
Thanks for the help.
Paul
"Ron de Bruin" <[email protected]> wrote in message
news:%[email protected]...
> Try this
>
> If Sheets("Setup").Range("L2").Value = "Jan" Then
> Kill FileNameZip3
> Else
> Kill FileNameZip2
> Kill FileNameZip3
> End If
>
>
> --
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
> "PCLIVE" <[email protected]> wrote in message
> news:%[email protected]...
>> Ok Ron,
>>
>> Here's what I got. I need to kill one or two files based on an if
>> statement. If L2 = "Jan", then I need to delete FileNameZip3. Else I
>> need to delete two files, FileNameZip2 and FileNameZip3. How would I do
>> this? If there is such thing as a block Else statement...
>>
>> If Sheets("Setup").Range("L2").Value = "Jan" _
>> Then Kill FileNameZip3 _
>> Else Kill FileNameZip2
>> Kill FileNameZip3
>>
>> Thanks,
>> Paul
>>
>> "Ron de Bruin" <[email protected]> wrote in message
>> news:[email protected]...
>>> Have you try it ?
>>> Answer is No
>>>
>>> If you want to delete all files in a folder you can do this
>>>
>>> On Error Resume Next
>>> Kill "C:\folder\*.*"
>>>
>>>
>>>
>>>
>>> --
>>> Regards Ron de Bruin
>>> http://www.rondebruin.nl
>>>
>>>
>>> "PCLIVE" <[email protected]> wrote in message
>>> news:[email protected]...
>>>> The following code works fine.
>>>>
>>>> Kill FileNameZip2
>>>> Kill FileNameZip3
>>>>
>>>>
>>>> Would the following code do the same?
>>>>
>>>> Kill FileNameZip2 & FileNameZip3
>>>>
>>>> Thanks,
>>>> Paul
>>>>
>>>
>>>
>>
>>
>
>
No, that would append the two filename strings into one. It would be the
same as doing
Kill "C:\File1.txtC:\File2.txt"
"PCLIVE" wrote:
> The following code works fine.
>
> Kill FileNameZip2
> Kill FileNameZip3
>
>
> Would the following code do the same?
>
> Kill FileNameZip2 & FileNameZip3
>
> Thanks,
> Paul
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks