ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   2 Questions, Saving a file from a specific cell value, and Searchi (https://www.excelbanter.com/excel-discussion-misc-queries/82416-2-questions-saving-file-specific-cell-value-searchi.html)

Peter

2 Questions, Saving a file from a specific cell value, and Searchi
 
Hello Experts,
I would like to know if there is a way to save a workbook with the value
held in a cell.
Also, I'd like to be able to use a command button to enable searching and
loading of a file. It would also need to display the files found that match
the search.

I have no idea how to record a macro that can do these things and is why I
have approached the minds who know excel inside out.

Thanks
Peter

Tom Ogilvy

2 Questions, Saving a file from a specific cell value, and Searchi
 
Activeworkbook.SaveAs filename:="C:\MyFolder\" & _
Worksheets("Sheet3").Range("A1").Value & ".xls", _
FileFormat:=xlWorkbookNormal


Possibly

fname = Application.GetOpenFileName()

This can be set up to limit the files displayed by extension. See Excel VBA
help for examples. It just returns the name of the file selected. You
would then need to use the workbook.open command to actually open the file.

If you really want to search, then perhaps look at FileSearch Object
although many claim they have problems with it.

http://msdn.microsoft.com/library/de...ce09072000.asp



--
Regards,
Tom Ogilvy


"Peter" wrote:

Hello Experts,
I would like to know if there is a way to save a workbook with the value
held in a cell.
Also, I'd like to be able to use a command button to enable searching and
loading of a file. It would also need to display the files found that match
the search.

I have no idea how to record a macro that can do these things and is why I
have approached the minds who know excel inside out.

Thanks
Peter


Peter

2 Questions, Saving a file from a specific cell value, and Sea
 
Thanks Tom, This has put me on the right track =)

"Tom Ogilvy" wrote:

Activeworkbook.SaveAs filename:="C:\MyFolder\" & _
Worksheets("Sheet3").Range("A1").Value & ".xls", _
FileFormat:=xlWorkbookNormal


Possibly

fname = Application.GetOpenFileName()

This can be set up to limit the files displayed by extension. See Excel VBA
help for examples. It just returns the name of the file selected. You
would then need to use the workbook.open command to actually open the file.

If you really want to search, then perhaps look at FileSearch Object
although many claim they have problems with it.

http://msdn.microsoft.com/library/de...ce09072000.asp



--
Regards,
Tom Ogilvy


"Peter" wrote:

Hello Experts,
I would like to know if there is a way to save a workbook with the value
held in a cell.
Also, I'd like to be able to use a command button to enable searching and
loading of a file. It would also need to display the files found that match
the search.

I have no idea how to record a macro that can do these things and is why I
have approached the minds who know excel inside out.

Thanks
Peter



All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com