Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

macros opening files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MSHO - 22 Feb 2006 15:45 GMT
Hello

I have a macro that prompts the user to open a file. Currently it is a .csv
file but i want it to be able to open .csv or .xls. This is my code:

fileToOpen = Application.GetOpenFilename("Excel Files (*.csv), *.csv")

Is there a way i can add an OR or AND somehow or make it be able to open any
sort of file?

Thanks in Advance
Martin Fishlock - 22 Feb 2006 16:05 GMT
Try

fileToOpen = Application.GetOpenFilename( _
"Excel Files (*.csv;*.xls), *.csv;*.xls")

or

fileToOpen = Application.GetOpenFilename( _
"Comma Seperated Value Files (*.csv),*.csv,Excel Files (*.xls),*.xls")

Signature

HTHs Martin

> Hello
>
[quoted text clipped - 7 lines]
>
> Thanks in Advance
MSHO - 22 Feb 2006 16:22 GMT
Thanks so much!

> Try
>
[quoted text clipped - 17 lines]
> >
> > Thanks in Advance
Ron de Bruin - 22 Feb 2006 17:00 GMT
Hi

Try this macro

Sub test()
   Application.ScreenUpdating = False
   Dim R As Long
   Dim rng As Range
   Set rng = ActiveSheet.UsedRange
   For R = rng.Rows.Count To 1 Step -1
       rng.Rows(R + 1).Resize(7).EntireRow.insert
   Next R
   Application.ScreenUpdating = True
End Sub

Signature

Regards Ron de Bruin
http://www.rondebruin.nl

> Hello
>
[quoted text clipped - 7 lines]
>
> Thanks in Advance
Ron de Bruin - 22 Feb 2006 17:05 GMT
Oops

This is the second time today I post in the wrong thread

Sorry

Signature

Regards Ron de Bruin
http://www.rondebruin.nl

> Hi
>
[quoted text clipped - 22 lines]
>>
>> Thanks in Advance
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.