+ Reply to Thread
Results 1 to 6 of 6

VBA that will open another workbook when cell value changes

  1. #1
    Registered User
    Join Date
    11-08-2012
    Location
    Greenville, SC
    MS-Off Ver
    Excel 2010
    Posts
    10

    VBA that will open another workbook when cell value changes

    I am trying to write a vba program will open another worbook from my "My Documents" when any cell in column in column Q is changed to "In Progress". This is what I have, but I cannot get the range to work.

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Address = "$Q" Then

    If Range(Cells("Q")).Value = "In Progress" Then

    Workbooks.Open "C:\Documents and Settings\"

    End If

    End If

    End Sub

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA that will open another workbook when cell value changes

    Try this.
    Please Login or Register  to view this content.
    You should add code tags to your post.

  3. #3
    Registered User
    Join Date
    11-08-2012
    Location
    Greenville, SC
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA that will open another workbook when cell value changes

    Great! It worked, thanks to Norie.

    What should I add to the program if I want to also look at column T to see if the corresponding cell value is "Scheduled" before opening the document. But if colmun T is blank, end the program without opening.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA that will open another workbook when cell value changes

    Perhaps this.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-08-2012
    Location
    Greenville, SC
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA that will open another workbook when cell value changes

    Thanks for the help Norie; it worked perfect.

  6. #6
    Registered User
    Join Date
    11-08-2012
    Location
    Greenville, SC
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA that will open another workbook when cell value changes

    I am fairly new at VBA programming, so there is one more thing that I am trying to figure out. Adding to the above code, I want the code to open and save the workbook to the location which is specified by a hyperlink on column B of the original worksheet.

+ 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