+ Reply to Thread
Results 1 to 6 of 6

open folders

  1. #1
    Registered User
    Join Date
    01-26-2009
    Location
    US,Texas
    MS-Off Ver
    Excel 2007
    Posts
    3

    open folders

    hi all,

    i have some folders. they start 00001, 00002...... and end 00290, 00291. so folders names are in array. these folders have struct1.str and struct2.str files. i need to open these folders and use struct1.str and struct2.str files with macro.

    thanks for your response

    selcan
    Last edited by slcnrtm; 01-26-2009 at 03:11 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: how to open folders?

    Welcome to the forum.

    No attachment.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-26-2009
    Location
    US,Texas
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: open folders

    Thank you.

    sorry i forgot the attachment. but it is ok now...

    i am waiting for your response.
    Attached Files Attached Files
    Last edited by slcnrtm; 01-26-2009 at 05:09 PM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: open folders

    So I see some text files with numeric names 0001, 0002, ..., and inside those, some references to struct1.str, struct2.str. Interestingly, you have lots of files with the same name and different contents in the zip file; how did you do that - Windows isn't going to allow those to be in the same directory.

    Assuming that gets sorted, what is it you want to do?

  5. #5
    Registered User
    Join Date
    01-26-2009
    Location
    US,Texas
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: open folders

    Quote Originally Posted by shg View Post
    So I see some text files with numeric names 0001, 0002, ..., and inside those, some references to struct1.str, struct2.str. Interestingly, you have lots of files with the same name and different contents in the zip file; how did you do that - Windows isn't going to allow those to be in the same directory.

    Assuming that gets sorted, what is it you want to do?
    these are test results. all folders are different name like (00001, 00002...) but files in these folders have same name (struct1.str, struct2.str). i try to copy a part of (struct1.str, struct2.str). i am trying to make below codes to all of them.

    sub macro5 ()

    Workbooks.OpenText Filename:= _
    "C:\Selcan\AAPTP proje ile ilgili belgeler\UTEP_slab\UTEP_Slab\Delaminated_slab_test1\00001\struct1.str" _
    , Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
    xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
    Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
    Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1)), TrailingMinusNumbers:=True

    Range(Cells.Find(what:="wavelength", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Offset(1, -2), Cells.Find(what:="Thickness", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Offset(-2, -1)).Activate

    Selection.Copy
    Windows("calling2.xlsm").Activate
    ActiveWindow.SmallScroll Down:=-15
    Range("A4").select
    ActiveSheet.Paste
    Windows("struct1.str").Activate
    ActiveWindow.Close

    Workbooks.OpenText Filename:= _
    "C:\Selcan\AAPTP proje ile ilgili belgeler\UTEP_slab\UTEP_Slab\Delaminated_slab_test1\00001\struct2.str" _
    , Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
    xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
    Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
    Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1)), TrailingMinusNumbers:=True


    Range(Cells.Find(what:="wavelength", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Offset(1, -2), Cells.Find(what:="Thickness", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Offset(-2, -1)).Activate

    Selection.Copy
    Windows("calling2.xlsm").Activate
    ActiveWindow.SmallScroll Down:=-15
    ActiveCell.select
    ActiveCell.Offset(0, 2).select
    ActiveSheet.Paste
    Windows("struct2.str").Activate
    ActiveWindow.Close

    Workbooks.OpenText Filename:= _
    "C:\Selcan\AAPTP proje ile ilgili belgeler\UTEP_slab\UTEP_Slab\Delaminated_slab_test1\00002\struct1.str" _
    , Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
    xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
    Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
    Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1)), TrailingMinusNumbers:=True

    Range(Cells.Find(what:="wavelength", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Offset(1, -2), Cells.Find(what:="Thickness", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Offset(-2, -1)).Activate

    Selection.Copy
    Windows("calling2.xlsm").Activate
    ActiveWindow.SmallScroll Down:=-15
    ActiveCell.select
    ActiveCell.Offset(0, 2).select
    ActiveSheet.Paste
    Windows("struct1.str").Activate
    ActiveWindow.Close

    Workbooks.OpenText Filename:= _
    "C:\Selcan\AAPTP proje ile ilgili belgeler\UTEP_slab\UTEP_Slab\Delaminated_slab_test1\00002\struct2.str" _
    , Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
    xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
    Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
    Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1)), TrailingMinusNumbers:=True

    Range(Cells.Find(what:="wavelength", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Offset(1, -2), Cells.Find(what:="Thickness", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Offset(-2, -1)).Activate

    Selection.Copy
    Windows("calling2.xlsm").Activate
    ActiveWindow.SmallScroll Down:=-15
    ActiveCell.select
    ActiveCell.Offset(0, 2).select
    ActiveSheet.Paste
    Windows("struct2.str").Activate
    ActiveWindow.Close

    End Sub

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: open folders

    Please take a few minutes to read the forum rules, then edit your post to add code tags.

    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1