Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Kill command using &

The following code works fine.

Kill FileNameZip2
Kill FileNameZip3


Would the following code do the same?

Kill FileNameZip2 & FileNameZip3

Thanks,
Paul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Kill command using &

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" wrote in message ...
The following code works fine.

Kill FileNameZip2
Kill FileNameZip3


Would the following code do the same?

Kill FileNameZip2 & FileNameZip3

Thanks,
Paul



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Kill command using &

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Kill command using &

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" wrote in message
...
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" wrote in message
...
The following code works fine.

Kill FileNameZip2
Kill FileNameZip3


Would the following code do the same?

Kill FileNameZip2 & FileNameZip3

Thanks,
Paul





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Kill command using &

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" wrote in message ...
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" wrote in message ...
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" wrote in message ...
The following code works fine.

Kill FileNameZip2
Kill FileNameZip3


Would the following code do the same?

Kill FileNameZip2 & FileNameZip3

Thanks,
Paul









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Kill command using &

That's it. Pretty simple, but my brain wasn't functioning.

Thanks for the help.
Paul

"Ron de Bruin" wrote in message
...
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" wrote in message
...
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" wrote in message
...
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" wrote in message
...
The following code works fine.

Kill FileNameZip2
Kill FileNameZip3


Would the following code do the same?

Kill FileNameZip2 & FileNameZip3

Thanks,
Paul









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
kill command and excel charles Excel Discussion (Misc queries) 7 August 30th 09 04:02 PM
Kill Michael Excel Programming 2 August 23rd 05 11:53 AM
'Kill' solomon_monkey Excel Programming 7 January 7th 05 09:56 AM
Kill command not working Larry Wood Excel Programming 1 May 15th 04 02:06 PM
Kill Command JamieD[_3_] Excel Programming 3 January 30th 04 01:20 PM


All times are GMT +1. The time now is 05:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"