MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
Public Function GetFileProperty(myFile As String, myType As String) As String 'This creates an instance of the MS Scripting Runtime FileSystemObject class Set oFS = CreateObject("Scripting.FileSystemObject") Select Case UCase(Trim(myFile)) Case "CREATED" GetFileProperty = oFS.GetFile(myFile).DateCreated Case "MODIFIED" GetFileProperty = oFS.GetFile(myFile).DateLastModified Case "ACCESSED" GetFileProperty = oFS.GetFile(myFile).DateLastAccessed Case "SIZE" GetFileProperty = oFS.GetFile(myFile).Size Case Else GetFileProperty = "txt" End Select End Function Public Sub SperiamoLoop() Dim MyCell As Variant, Rng As Range Set Rng = Sheets("Sheet1").Range("A2:A4") '''''sets the range to use For Each MyCell In Rng ''''checks each cell in range If MyCell <> "" Then '''''will only do something if the cell is not blank Call GetFileProperty(myFile, myType) '''Put your code here Else '''''if cell is equal to blank Exit Function ''''then quit macro End If Next End Sub
|New Criteria Prototype||3||16|
|Copy the value of Cell C5 into sheet2 Cell B5 if A1 on sheet 1 = (MCL). If cell C5 is empty (or 'No') do nothing. Is this possible?||7||25|
|Extracting data from a list with a positive value and creating a separare list from the results||5||34|
|locking multiple column ranges||10||22|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
8 Experts available now in Live!