...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)...
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...
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...
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...
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...
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...
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...
...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
...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...
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...
...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#...
...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...
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...
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...
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
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.