• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Can't get kill command to work

RangeA1

New Member
Code:
Sub qgo()
'
' qgo Macro
'

ChDrive "D"
ChDir "D:\Audio\aaatakeAll\"
Dim bip As String
Dim vv1 As String
 
  Range("a1").Select
  While Not IsEmpty(ActiveCell)
  vv1 = ActiveCell.Value
  vv1 = vv1 & "\"
'  SetAttr vv1, vbNormal
  'MsgBox (vv1)
  'End
   On Error GoTo ErrorHandler
   vlen = Len(ActiveCell.Value)
 
  For t = 1 To vlen
  bip = Mid(ActiveCell.Value, t, 1)
  If bip = "?" Then
  t = vlen
  Kill vv1
  Kill vv1
 'ActiveCell.Value = ""
  ActiveCell.Interior.ColorIndex = 15
  End If

ErrorHandler:
  'error
   Resume Next

  Next t
  ActiveCell.Offset(1, 0).Select
 
  Wend
  ChDrive "C"
  Range("a1").Select
 
Confused about whether I need to have a backslash in address, if I need to change drive is the drive is in the address, what else, I don't know
 
This example uses the Kill statement to delete a file from a disk.

VBCopy

' Assume TESTFILE is a file containing some data.
Kill "TestFile" ' Delete file.

' Delete all *.TXT files in current directory.
Kill "*.TXT"
 
Back
Top