Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. feipezi

    Do we have a VBS version of listing files in a folder?

    ...in Window Explorer. Thanks in advance. Here is the Excel macro/function 'FILELIST'. Function FileList(fldr As String, Optional fltr As String = "*.*") As Variant Dim sTemp As String, sHldr As String If Right$(fldr, 1) <> "\" Then fldr = fldr & "\" sTemp = Dir(fldr & fltr)...
  2. feipezi

    How to make a recorded Excel macro (convert a text file to a Workbook) more efficient?

    Thanks folks for your reply. Andy, sorry that I cannot provide samples due to company policy, which is getting stricter and stricter. We all know nobody can take a few lines of data to perform fraud... combo, I tested your code. It should be working but the TXT file that I used has no specific...
  3. feipezi

    How to make a recorded Excel macro (convert a text file to a Workbook) more efficient?

    Hi, I recorded a macro that can convert a text file into an Excel workbook. But the code looks messy with quite some redundant statements. I tried to streamline it but with no success. Like the Arrays, do we need that many arrays? Besides, what if I have more than 30 fields? That being the...
  4. feipezi

    How to get the macros back as they vanish somehow in a AccessDB?

    Hello combo, please see my comments below, in upper case. I understood that your recent database has no macros (i.e. at least VBA, as you checked this in VBE), with recent data from May. You have older copies, working, latest with April data. I am right? YES, YOU'RE RIGHT. I'M RUNNING JUNE...
  5. feipezi

    How to get the macros back as they vanish somehow in a AccessDB?

    Hello dHookom I tried your way but did see any hidden macros. I will keep checking because the size of the DB is bigger than expected. I still suspect there be some old macros hidden somewhere. Hey combo, I understand what you recommended. But the fact is the new data is supposed to be created...
  6. feipezi

    How to get the macros back as they vanish somehow in a AccessDB?

    Thanks combo for the quick response! I can certainly try what you suggested. But the old (or the problematic DB) has no macros any more. It means I need another similar DB where macros are residing to be the source so I can copy the macros over to the new DB, correct? Btw, after I copied the...
  7. feipezi

    How to get the macros back as they vanish somehow in a AccessDB?

    Hello folks, I have an AccessDB with a size of abound 30 MG. There are tons of macros in it. I am responsible for running some production jobs at the beginning of a month. A few associates did the similar thing a few days ago. As I took over, I found none of the butotns, back up by some macros...
  8. feipezi

    Hoe to fix run time error 2147217900 (80040e14) syntax error in Order By clause

    ....Provider = "Microsoft.ACE.OLEDB.12.0" .ConnectionString = DataSource .Open End With ConnCmd.ActiveConnection = ConnObj strSQL = "SELECT TOP 10 * FROM " & dsn _ & " WHERE " & DTE & " BETWEEN " & S_DT & " AND" & E_DT & " ORDER BY" & DTE & " DESC" Debug.Print strSQL ConnCmd.CommandText =...
  9. feipezi

    Hoe to fix run time error 2147217900 (80040e14) syntax error in Order By clause

    ...errors. Let me know if you want the whole program. Please advise. Thanks. Sub ExportAccessDBtoExcel(dsn As String, DTE As Long) ... ConnCmd.CommandText = "SELECT TOP 50 * FROM " & dsn _ & "ORDER BY " & DTE & "DESC" ... Sub tnt() ExportAccessDBtoExcel "CO_PNC_CO_RPT_NBEXTRACT", TRANDATE End Sub
  10. feipezi

    How to pull data from MS Access DB and place on an Excel spreadsheet with WHERE clause?

    ...Andy. I was out of town. Some more questions. Sub ExportAccessDBtoExcel(dsn As String, DTE As Long) ... ConnCmd.CommandText = "SELECT TOP 50 * FROM " & dsn _ & "ORDER BY " & DTE & "DESC" ... Sub tnt() ExportAccessDBtoExcel "CO_PNC_CO_RPT_NBEXTRACT", TRANDATE End Sub got error like 'byref...
  11. feipezi

    How to pull data from MS Access DB and place on an Excel spreadsheet with WHERE clause?

    ...& _ "Data Source=C:\Users\John\Favorites\Documents\tcs\testwork.xlsx;" & _ "Extended Properties=Excel 12.0" str = "MED D" jqzSQL = "SELECT * FROM [sheet1$]" & _ " WHERE account_type like '" & str & "%'" Set jqzRecordset = New ADODB.Recordset jqzRecordset.Open jqzSQL, jqzConnect...
  12. feipezi

    How to detect dups and/or sum by group?

    Hi, Is there any way of combining the following two Subs into one? Or it looks messay. Thanks. Sub SumByGroup(keyfield As String, datacol As Integer, destcol As Integer) 'keyfield: the field of key, datacol: Offset number, if keyfield is "a" then datacol=2 means data in field "c" 'destcol...
  13. feipezi

    How to pull data from MS Access DB and place on an Excel spreadsheet with WHERE clause?

    ...With ConnObj .Provider = "Microsoft.ACE.OLEDB.12.0" .ConnectionString = strDataSource .Open End With strSQL = "SELECT * FROM CO_PNC_CO_POLICY_TERM " _ & " WHERE STATUS LIKE '*In Progress*' " _ & " AND PAYMENT_STATUS IS NULL " _ & " AND TERM_START_DT BETWEEN #9/1/2010#...
  14. feipezi

    How to pull data from MS Access DB and place on an Excel spreadsheet with WHERE clause?

    ...ConnObj .Provider = "Microsoft.ACE.OLEDB.12.0" .ConnectionString = DataSource .Open End With ConnCmd.ActiveConnection = ConnObj ConnCmd.CommandText = "SELECT * FROM CO_PNC_CO_POLICY_TERM WHERE [STATUS] LIKE 'Active' AND [PAYMENT_STATUS] LIKE 'Current'" ConnCmd.CommandType = adCmdText...
  15. feipezi

    How to find a string from multiple Word files, which are listed on an Excel spreadsheet?

    Sorry folks that you feel that way. Yes, all 132 files are on a spreadsheet of Excel but I will read them from a folder, because the filenames on the spreadsheet have no path or folder name. I tried using VBS to read the files and pick the file I need. Please check the code below. Dim Word...
  16. feipezi

    How to find a string from multiple Word files, which are listed on an Excel spreadsheet?

    Hello Strongm, Thanks for replying. I don't really concern the code is in Excel or Word. I guess it's relatively easier to do it in Word because it is the Word documents that I need to find out about. Here is why I am doing that. I need to check some contents of one particular document, among...
  17. feipezi

    How to find a string from multiple Word files, which are listed on an Excel spreadsheet?

    Hey Combo, I tried your way of placing the code in an Excel VBA editor and I got some errors shown in the attached. Could you give me more details about your 'reference'? Thanks again. https://files.engineering.com/getfile.aspx?folder=fd73025a-a8b9-4b4f-a9f9-2a7c40827f82&file=Capture0308.PNG
  18. feipezi

    How to find a string from multiple Word files, which are listed on an Excel spreadsheet?

    Okay. Sorry that I didn't make myself understood. Let me try again. What I need is a For loop or While loop to loop thru a whole bunch of Word documents in a folder. And it has nothing to do with Excel. But the macro should be residing in a Word document's VBA editor. I have a small search...
  19. feipezi

    How to find a string from multiple Word files, which are listed on an Excel spreadsheet?

    Thanks for the quick return! You can see from the attached that I have about 82 files (docx) for me to go through. But they are all on an Excel spreadsheet. I can set up a FOR loop the loop through the 82 cells on Col B but that's in Excel. How can I link it to Word so your code can be...

Part and Inventory Search

Back
Top