VBA Problems

  • Thread starter Thread starter Stromma
  • Start date Start date
S

Stromma

Hi All!

I have a backup sub that saves workbook data to a floppy disc. How ca
i delete all data (emtpy the whole disc) that's already on the flopp
before saving the new one?

In one worksheet data is saved from columns ("A:E") and the date whe
it was saved is i column ("F"). Every monday i printout all data tha
was saved the week before. I want create a printout userform with t
ComboBoxes that allows me to print from the date i select, ex:
Print from "2004-02-16" (ComboBox1) to "2004-02-20" (ComboBox2).
I know how to create the UserForm and how to set the ListFillRange fo
the ComboBoxes, but how can i use the selection of the ComboBoxes t
set the printout range?

Cheers

/Stromm
 
Let's see you sub. Hope you are not saving to the floppy. You should save to
HD and COPY to the floppy.
Have a look at vba HELP indes for KILL to kill the files first
HTH

Sub CopyToFloppy()
Application.DisplayAlerts = False
IsFloppyReady ' Macro below
Dim fso As Object
myfile = ActiveWorkbook.Name
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "c:\yourfolder\" & myfile, "a:\"
Application.DisplayAlerts = True
End Sub

Sub IsFloppyReady()
Dim drv As String
Dim s As String
Dim fso
s = "Drive A has no Floppy..." & vbLf & _
"Please insert a floppy in the 'A' Drive"
Set fso = CreateObject("Scripting.FileSystemObject")
With fso
drv = .GetDriveName("A:\")
'// Is Drive Ready? (No Floppy in A:)?
If Not .getdrive(drv).IsReady Then
MsgBox s
End If
End With
End Sub
 
Back
Top