+ Reply to Thread
Results 1 to 7 of 7

Search and open feature

Hybrid View

  1. #1
    NickHK
    Guest

    Re: Search and open feature

    Tom,
    Yes, look:
    > Sub Macro1() <<<<<<<<< 1 sub
    > '
    > ' Macro1 Macro
    > ' Macro recorded 4/07/2006 by BPPassPort User
    > '
    > ' Keyboard Shortcut: Ctrl+t
    > '
    >
    > Sub OpenWorkbook() <<<<<<<<< 2 sub


    NickHK

    "TomBP" <TomBP.2akkln_1152266106.7538@excelforum-nospam.com> wrote in
    message news:TomBP.2akkln_1152266106.7538@excelforum-nospam.com...
    >
    > This is another macro I use for another sheet. This works fine and I see
    > no difference in standard lines with the macro which isn't working
    >
    >
    > Code:
    > --------------------
    > Sub Macro2()
    > '
    > ' Macro2 Macro
    > ' Macro recorded 4/07/2006 by BPPassPort User
    > '
    > ' Keyboard Shortcut: Ctrl+t
    > '
    > Dim s As String, s1 As String
    > s = ActiveSheet.Range("F10").Text
    > s1 = "C:\Documents and Settings\" & _
    > "fackt0\Desktop\Excel probleem\Shipments\"
    > ActiveWorkbook.SaveAs _
    > Filename:=s1 & s & ".xls", _
    > FileFormat:=xlNormal, _
    > Password:="", _
    > WriteResPassword:="", _
    > ReadOnlyRecommended:=False, _
    > CreateBackup:=False
    > End Sub
    > --------------------
    >
    >
    >
    > This is the macro which isn't working again.
    >
    >
    > Code:
    > --------------------
    > Sub Macro1()
    > '
    > ' Macro1 Macro
    > ' Macro recorded 4/07/2006 by BPPassPort User
    > '
    > ' Keyboard Shortcut: Ctrl+t
    > '
    >
    > Sub OpenWorkbook()
    > Dim s1 as String, bk as Workbook, bk1 as Workbook
    > s1 = "C:\Documents and Settings\" & _
    > "fackt0\Desktop\Shipments\"
    >
    > set bk = activeWorkbook
    > if dir(s1 & Range("C3").Text & ".xls") <> "" then
    > set bk1 = Workbooks.Open(s1 & Range("J5").Text & ".xls")
    > bk.Activate
    > else
    > msgbox "workbook not found"
    > End if
    > End sub
    > --------------------
    >
    >
    > --
    > TomBP
    > ------------------------------------------------------------------------
    > TomBP's Profile:

    http://www.excelforum.com/member.php...o&userid=36112
    > View this thread: http://www.excelforum.com/showthread...hreadid=559237
    >




  2. #2
    Forum Contributor
    Join Date
    07-06-2006
    Posts
    108
    Thanks a lot for your help. It works like a charm now.
    Last edited by TomBP; 07-07-2006 at 08:12 AM.

+ 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