Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try
fileToOpen = Application.GetOpenFilename( _ "Excel Files (*.csv;*.xls), *.csv;*.xls") or fileToOpen = Application.GetOpenFilename( _ "Comma Seperated Value Files (*.csv),*.csv,Excel Files (*.xls),*.xls") -- HTHs Martin "MSHO" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks so much!
"Martin Fishlock" wrote: Try fileToOpen = Application.GetOpenFilename( _ "Excel Files (*.csv;*.xls), *.csv;*.xls") or fileToOpen = Application.GetOpenFilename( _ "Comma Seperated Value Files (*.csv),*.csv,Excel Files (*.xls),*.xls") -- HTHs Martin "MSHO" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -- Regards Ron de Bruin http://www.rondebruin.nl "MSHO" wrote in message ... 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oops
This is the second time today I post in the wrong thread Sorry -- Regards Ron de Bruin http://www.rondebruin.nl "Ron de Bruin" wrote in message ... 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 -- Regards Ron de Bruin http://www.rondebruin.nl "MSHO" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Opening Excel2003 files w/macros in 2007 - how? | Setting up and Configuration of Excel | |||
How do I stop Excel from opening all files w/macros & running them | Excel Discussion (Misc queries) | |||
Auto run of macros immediately after opening the files | Excel Worksheet Functions | |||
Using VBA to disable macros when opening files | Excel Programming | |||
Auto run macros when opening CSV files | Excel Programming |