LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Allow user input into VBA Module?

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


 
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
Prompt user for input and utilize that input ninner Excel Worksheet Functions 2 March 28th 07 09:44 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
Calling an Excel/VBA User Created Module from WSH None Excel Programming 3 April 14th 05 01:03 AM
Making Contents of a cell input for a Module anyuan Excel Programming 0 June 28th 04 06:49 AM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


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

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

About Us

"It's about Microsoft Excel"