LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Open folder based on cell value

burl_h wrote on 1/28/2012 :
I just figured it out (how to chnage the date "month/day/year" to
"month-day-year" the following works nicely

Dim lRow As Long
lRow = ActiveCell.Row
Const sInitPath As String = "C:\Users\Public\Pictures\" '//main path
'Add subfolder[s]
strpath = sInitPath & Cells(lRow, "B") & "\" & Format(Cells(lRow,
"C").Value, "MM-DD-YY") & "\"

strfile = Dir(strpath & "\*.jpg")

Garry, thanks for all your help.

Burl_h


You're welcome! However, if you persist to add the trailing backslash
on the path string then you should remove it from the start of the file
extension string. I deliberately put it here because paths normally do
not contain the trailing backslash.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


 
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
Should be simple: Lookup a picture from a folder based on a cell value changing Finny388 Excel Programming 8 April 19th 07 09:36 PM
User selection of folder and open all .xls files within folder Barb Reinhardt Excel Programming 4 April 14th 07 01:41 PM
Help: Can open a spreadsheet in a folder which contains spaces in the folder name! 1tsols Excel Programming 17 July 31st 06 04:26 PM
save to folder based on cell value Steve Excel Discussion (Misc queries) 1 June 15th 06 07:54 PM
open file from folder save in new folder tim64[_3_] Excel Programming 20 June 17th 05 07:58 PM


All times are GMT +1. The time now is 10:55 PM.

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

About Us

"It's about Microsoft Excel"