create macro for the below scenario I need to search whether "Sep-13" folder is available in my desktop. If folder is there then i need to open the folder else i need to creat a folder in the name "Sep-13" and open the folder.
Im am trying to create a search marco button that allows me to search in multiple worksheets in one work book. I came across this CODE the first part of it works. It pops open user input box and ask for the word that i would like to search but the this error message pops up Runtime error1004 Method 'range" of object'_Global'failed and i dont know what to do
Private Sub SearchButton_Click() SearchString = InputBox("Enter Search String", "Search") If SearchString = "" Then Exit Sub For Each c In Range(myRange) If InStr(LCase(CStr(c)), LCase(SearchString)) Then
I found some code on here the other day which will do though all the files in a folder and send them to a zip file which works great how to zip a single fixed file. I down load files from our oracle system daily and need to keep them but want to keep the file size down.
Sub ZipPackage() Dim ZipFile, TargetFolder, NewFileName, ofile Dim o As Object
But the "ofile" doesnt contain the file type. Is there away to adjust this code so it recognises what the file type is?
I would like to write a mocro which open the search files in a folder window. The window will get parametrs through the macro and should show the results. I tried to record it from file menu, but it didn't work.
I need help in creating a code which will search for files in a destination path and popluate a table to tell me if the file is present(Yes or No).
To explain I need a code which will find a specific path depending on the criteria and check if the files are present in those folders. These files will be named as todays date. Please find below the table format....
On this forum I read about the application "FileSearch" that doesn't work in office 2007. I used the macro on below in office 2003 and it worked. Now I upgraded to Office 2007 and it doesn't work. But if you search "NewSearch method" in the MS Excel Help you can find that the application exists and it has the same morphology I am using!! Why Doesn't it work??
With Application.FileSearch .NewSearch 'Change path to suit .LookIn = pPath .FileType = msoFileTypeExcelWorkbooks .Filename = "*.xls" If .Execute > 0 Then 'Workbooks in folder Redim FNameArr(.FoundFiles.Count).......................
I don't seem to be able to combine the looping through a set of workbooks with the IsFileOpen function posted by microsoft.
Basically this code works if the foundfile(j) is closed, but if it is already open I cannot activate the foundfile(j) and make it do things.
I'm not posting the ISFileOpen function because already present inside the forum and the rest of the code because it's too long...
With Application.FileSearch .NewSearch ' . ScreenUpdating = False .LookIn = MyPath(40) '* represents wildcard characters .FileType = msoFileTypeExcelWorkbooks If .Execute > 0 Then 'Workbook exists For j = 1 To .FoundFiles.Count If IsFileOpen((.FoundFiles(j))) Then 'neither of these three options work
I want to search for some text in a file. If found, I want to copy that file into another folder. I'm using the code below to do half the job.
Sub test() With Application.FileSearch .NewSearch .LookIn = "C:Documents and SettingscDesktop1" .SearchSubFolders = True .Filename = "*.htm" .TextOrProperty = "Status Rekod" .MatchAllWordForms = True .FileType = msoFileTypeAllFiles If .Execute() > 0 Then For I = 1 To .FoundFiles.Count 'I want to use the FileCopy function here to copy the found files to 'C:Documents and SettingscDesktop est. How do I do this? Next I Else MsgBox "There were no files found." End If End With End Sub
I am using Excel 2007 so I CANNOT use application.filesearch.
With that said, I need to change one of my old macros that searched for the newest file within a specified folder, and then display the name of that file in a message box that gives the person an option of opening the file. I've read too many workarounds for application.filesearch and I'm not sure how to combine them all into something I can use.
Normally I have a bit of code to start with, but this one has me so baffled I don't know where to start.
i am trying to open a get a code working that will enable me to enter a file name in a cell of the current workbook open, then search through a root directory and subfolders, find the file and open it. the code below i giving me grief. i am using 2007 excel.
I am wondering if it is possible to get excel to Create a new folder from a cell value? I am entring data into cells Eg A1-F1, and then the next line of data is in A2-F2 and so on. What I'd like is when I enter data (the date) in the F column then it will create a folder with the value of H2 (=A2&B2&D2&E2)
I'm trying to create a link to a folder and to insert it in a cell. The folder name is: "C:DISCO CTEMPLATES #1". I tried to copy that text and paste it into the cell. Excel recognizes that as a hyperlink but when I click the cell a message appears: "Cannot open the selected file" Could the problem be because of the "#" symbol?
I am after tips on creating a macro in Excel 2010 where it will search a list of folder paths in a column on a spreadsheet and insert a jpeg within the sheet from that folder if it exists. If more than one jpeg exists i would like it to insert the first jpeg only. i have found tips where it will insert images if you know the filename, however I don't have this luxury as file naming routines vary from folder to folder the only constant is that the file is a .jpg format.
I'm having a little trouble making this code work correctly. This macro, Once finished, is connected to a (Save) command button. Here is what is suppose to happen, First thing to remember is another sheet (Sheet1) has been populated with various information which is used as a receipt. The information came from sheet2. I need to copy sheet1 just as it is, format included, create a new empty sheet, paste the information into the new sheet, name the new sheet with the values from cells in sheet2, E3, D3, and the date formatted as the month and year only. Then I need to create a folder in the my documents folder named from the values from sheet2, E3, D3, and todays date with the current time. If the folder already exists, then I just need it to change to that folder, and save the newly created worksheet (as named above) into that folder. After the save is executed, I need to delete that new sheet from the current workbook. Then I need to return to sheet2 to the last active cell and run the last few lines of code which collects the value of the cell 1 to the right of the active cell and transfers it to the cell 1 to the left of the active cell.
VB: Public Sub Button11_Click() Dim wShell, fso, strFldr, xdir As String Dim newbal As String
I have a macro that creates a spreadsheet on a weekly basis and have been using it for quite sometime. Due to the large number of spreadsheets I would like to incorporate some code that would create a folder every month. I would assume that the code would need to include a check routine to see if a folder for that month exsists.
I have a macro that searches in all the excel files contained in a folder (weather files are opened or not) and returns the information (File name, Sheet name , Cell Address, and contents of the cell). I just want to amend the said code so that it copies not just the cell alone but" the entire row in which the cell is present".