prompting for filenames

D

dave glynn

Is it possible to have a macro prompt fro a filename. for example if data has
been copied from "oldfile" is it possible to have the macro ask which file it
now has to be copied to?

Many thanks

Dave
 
D

Dave Peterson

You could use something like:

Option Explicit
Sub testme()

Dim myFilename As Variant
myFilename = Application.GetSaveAsFilename

If myFilename = False Then
'user cancelled
Else
MsgBox "user selected: " & myFilename
'but you have to do the work--save or whatever
End If
End Sub
 
D

dave glynn

Thanks yet again!!

Kind regards

Dave

Dave Peterson said:
You could use something like:

Option Explicit
Sub testme()

Dim myFilename As Variant
myFilename = Application.GetSaveAsFilename

If myFilename = False Then
'user cancelled
Else
MsgBox "user selected: " & myFilename
'but you have to do the work--save or whatever
End If
End Sub
 
D

dave glynn

I have a number of worksheets that are identical except that the workbook
name changes with each company.

Can I use the "real" name (i.e: sheet1) rather than the Excel (abcinc) name
when getting data for a group report. This would save an imense amount of
time as therer are 640 different sheets.

Thanks


Dave Glynn
 
D

dave glynn

it seems that i can no longer post new questions as the message box doesn't
appear when i click on "new" so i have to go to an old question to post a new
onw . any thoughts.

thanks again


dave
 
Top