Importing an Excel file and prompting user for input
Well, that looks like it'll open the document. What about reading the
document and copying specific information out of it into a new document? Does
Excel have a 'read file' command?
Hmm.. thanks though that will start heading me in the right direction.
" wrote:
On 20 Sep, 16:06, Mitch wrote:
I'm still new to this, but I'm looking at WMI to maybe do this. (Please
correct me if I should just use .net to do this.)
I'm looking at a 'report file' in Excel, I can either CSV it or keep it in
the same format.
I need to copy that information and basically 'add' specific information
say, name, invoice, item and cost, and prompt the user for a special note, or
say if it's not a unique order.
Is this possible in Excel (Prompting for a file import, then prompting the
user for input via dialogue boxes?)
Or should I look at a script file to just handle the construction of the file?
Mitch
Its possible in Excel, this should get you started:
File import in vba would be:
dim TestName as Variant
TestName = Application.GetOpenFileName()
if TestName = False then
Msgbox "No File Selected"
Exit Sub
End if
Workbooks.open TestName
An input box would be:
dim TmpStr as String
TmpStr = InputBox("Enter Note", "Please Enter a note")
Range("A1") = TmpStr 'Users Note in cell A1
James
|