Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Everybody, still trying to learn VB, but I can not find the answer to this.
My macro opens a .xls file and then afterwards saves it as a .csv, the variable f has the File Name including the ext .xls, when saved I end up with MyFile.xls.csv How can I lose the xls ext? Code Used F = Application.GetOpenFilename("XL Files (*.xl*), *.XL*") If F = False Then Exit Sub Workbooks.Open F ActiveWorkbook.SaveAs FileName:= _ "C:\...\" & F & ".csv", FileFormat _ :=xlCSV, Many Thanks in anticipation |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
If Right(F, 4) Like ".xl?" Then _ F = Left(F, LEN(F) - 4) & ".csv" ActiveWorkbook.SaveAs _ FileName:="C:\\...\" & F, _ FileFormat:=xlCSV In article , "PraxisPete" wrote: Hi Everybody, still trying to learn VB, but I can not find the answer to this. My macro opens a .xls file and then afterwards saves it as a .csv, the variable f has the File Name including the ext .xls, when saved I end up with MyFile.xls.csv How can I lose the xls ext? Code Used F = Application.GetOpenFilename("XL Files (*.xl*), *.XL*") If F = False Then Exit Sub Workbooks.Open F ActiveWorkbook.SaveAs FileName:= _ "C:\...\" & F & ".csv", FileFormat _ :=xlCSV, Many Thanks in anticipation |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks JE it worked a treat.
"JE McGimpsey" wrote: One way: If Right(F, 4) Like ".xl?" Then _ F = Left(F, LEN(F) - 4) & ".csv" ActiveWorkbook.SaveAs _ FileName:="C:\\...\" & F, _ FileFormat:=xlCSV In article , "PraxisPete" wrote: Hi Everybody, still trying to learn VB, but I can not find the answer to this. My macro opens a .xls file and then afterwards saves it as a .csv, the variable f has the File Name including the ext .xls, when saved I end up with MyFile.xls.csv How can I lose the xls ext? Code Used F = Application.GetOpenFilename("XL Files (*.xl*), *.XL*") If F = False Then Exit Sub Workbooks.Open F ActiveWorkbook.SaveAs FileName:= _ "C:\...\" & F & ".csv", FileFormat _ :=xlCSV, Many Thanks in anticipation |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Drop Down Lists: Allow option of adding own data if not in drop do | Excel Worksheet Functions | |||
Drop down lists that auto create and then filter the next drop down list | Excel Worksheet Functions | |||
how do I use one drop-list to modify another drop-lists options? | Excel Discussion (Misc queries) | |||
how do I link a drop down list entry to a new drop down cell? | Excel Discussion (Misc queries) | |||
Cross-referenced drop-down menu (nested drop-downs?) | Excel Worksheet Functions |