
07-21-2005, 04:03 AM
|
|
Registered User
|
|
Join Date: 13 Feb 2005
Posts: 66
|
|
Thanks for your help Bob. I modifyed your code with the replace line you gave me, and used the same command to 'crop' the displayed path file. Realistically that code would have worked, but like you said, the order in which file search returned the files was illogical, and unfortunately unusable for the intent I want to use it for.
I played with your code, but unfortunately couldn't get it to work. The reason for this is the code did not copy correctly. The forum software must have placed hard returns in your code, which turned it all red in the VBA editor.
Quote:
iLevel = Len(.FoundFiles(iCtr)) -
Len(Replace(.FoundFiles(iCtr), "\", ""))
sh.Hyperlinks.Add Anchor:=sh.Cells(iCtr, (iLevel -
iBaseLevel) * 2 - 1), _
Address:=.FoundFiles(iCtr), _
TextToDisplay:=.FoundFiles(iCtr)
sh.Cells(iCtr, (iLevel - iBaseLevel) * 2).Value =
FileDateTime(.FoundFiles(iCtr))
|
Some parts were obvious and I was able to manually delete the hard returns to make the code functional again. But its the middle part which threw me off, I couldn't get that to work. I figured I'd quote the entire erroneous part though, just incase my own editting was wrong.
Also, I notice the hyperlink command is in there. Can you show me what it would look like without the hyperlink command? Thanks again.
I appreciate all the help I have received with this by the way. You guys are making learning VBA a lot less stressful, as well as more entertaining
|