J
Joel Mills
I would like to be able to allow a user input the selected DBF file name
into the code instead of instructing them to name the DBF file as export.
Below is the code I currently use to copy the data into my worksheet. Also
there would need to be an error message that let them know that the file
wasn't opened if they either forget to open the file before running the
macro or misspell the name.
Any help would be appreciated.
Joel
Sub CopyData()
Worksheets("Export").Activate
'
Dim Asheet, Abook As String
Abook = ActiveWorkbook.Name
Asheet = ActiveSheet.Name
'This copies the data from the dbf file into the Worksheet Titled "Export"
Windows("Export.DBF").Activate
Range("A1").Select
ActiveCell.CurrentRegion.Select
Selection.Copy
Windows(Abook).Activate
Worksheets(Asheet).Activate
Range("A1").Select
ActiveSheet.Paste
Worksheets("Instructions").Activate
End Sub
into the code instead of instructing them to name the DBF file as export.
Below is the code I currently use to copy the data into my worksheet. Also
there would need to be an error message that let them know that the file
wasn't opened if they either forget to open the file before running the
macro or misspell the name.
Any help would be appreciated.
Joel
Sub CopyData()
Worksheets("Export").Activate
'
Dim Asheet, Abook As String
Abook = ActiveWorkbook.Name
Asheet = ActiveSheet.Name
'This copies the data from the dbf file into the Worksheet Titled "Export"
Windows("Export.DBF").Activate
Range("A1").Select
ActiveCell.CurrentRegion.Select
Selection.Copy
Windows(Abook).Activate
Worksheets(Asheet).Activate
Range("A1").Select
ActiveSheet.Paste
Worksheets("Instructions").Activate
End Sub