Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Need correct list property for coding a macro

I am trying to insert content from 1000 text files into a column in excel and
I found this module in another post and am trying to modify it. The word
that needs to be replaced with the correct property is "MsoAlertDefaultType".
I'm not very knowledgable in VB so any help is greatly appreciated! The
module is below:

Sub Test()
Call ListWordFiles("C:\Biology")
End Sub

Sub ListWordFiles(Folder As String)
Dim NextFile As String
Dim L As Long
On Error Resume Next

NextFile = Dir(Folder & "\*")
Do Until NextFile = ""
L = L + 1
Cells(L, 1) = Folder & "\" & NextFile
Cells(L, 2) = FileDateTime(Folder & "\" & NextFile)
Cells(L, 3) = MsoAlertDefaultType(Folder & "\" & NextFile)
NextFile = Dir()
Loop
End Sub


Thanks,

Kelly

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need correct list property for coding a macro

All that does is list the filenames and their datetime.

If your doing 1000 files, then hopefully they are less than 65 rows each (on
average).


Sub Test()
Call ListWordFiles("C:\Biology")
End Sub

Sub ListWordFiles(Folder As String)
Dim NextFile As String
Dim L As Long
On Error Resume Next
set sh = ActiveSheet
NextFile = Dir(Folder & "\*.CSV")
Do Until NextFile = ""
set bk = workbooks.Open(Folder & "\" & nextFile)
bk.worksheets(1).UsedRange.Copy Destination:= _
sh.Cells(rows.count,1).End(xlup)(2)
bk.Close SaveChanges:=False
Loop
End Sub

--
Regards,
Tom Ogilvy


"kwilson" wrote in message
...
I am trying to insert content from 1000 text files into a column in excel

and
I found this module in another post and am trying to modify it. The word
that needs to be replaced with the correct property is

"MsoAlertDefaultType".
I'm not very knowledgable in VB so any help is greatly appreciated! The
module is below:

Sub Test()
Call ListWordFiles("C:\Biology")
End Sub

Sub ListWordFiles(Folder As String)
Dim NextFile As String
Dim L As Long
On Error Resume Next

NextFile = Dir(Folder & "\*")
Do Until NextFile = ""
L = L + 1
Cells(L, 1) = Folder & "\" & NextFile
Cells(L, 2) = FileDateTime(Folder & "\" & NextFile)
Cells(L, 3) = MsoAlertDefaultType(Folder & "\" & NextFile)
NextFile = Dir()
Loop
End Sub


Thanks,

Kelly



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Correct coding entry of VBA macros in Excel worksheet Jack R Excel Worksheet Functions 3 November 30th 05 11:00 AM
Coding with pivots and Multiselect list job Excel Programming 3 February 1st 05 12:13 AM
Runtime error 380: Could not set the List property. invalid property value of listbox jasgrand Excel Programming 0 October 6th 04 09:28 PM
OnAction menu item property coding BrianB Excel Programming 1 July 13th 04 09:43 PM
color coding largest in a list Robert L. Salisbury Excel Programming 2 January 7th 04 02:05 PM


All times are GMT +1. The time now is 09:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"