+ Reply to Thread
Results 1 to 2 of 2

Linking Cells from a Browsed For Workbook

  1. #1
    Registered User
    Join Date
    04-07-2015
    Location
    Burnley, UK
    MS-Off Ver
    2013
    Posts
    19

    Linking Cells from a Browsed For Workbook

    Hello,

    I am currently attempting to construct a materials and costs calculation workbook.
    On one part of it there is some project specific details. What I want to do is to have a button added on the sheet where the user of the workbook can select it, and then browse for another workbook used in the project.
    Once this is done, it takes values from that workbook and places them into this new workbook. Since my excel crashes occasionally when trying to open several workbooks, ideally they should not need to open the other workbook. (I hope that makes sense).
    I have had a good look around the web, but whereas a few came close to what I wanted, none really gave my exactly what I want.
    The main issue is that the workbook they chose wont be the same each time as there's one for each project, but thankfully they all follow a standard template.
    As in if they was filling it out for project 001, they would select the other workbook already created in Project 001. And so when they do Project 002, they'll select the workbook used in Project 002. (if that makes it any clearer).

    I can use VBA, but I am no wiz on it.

    Any help would be great.

    Thanks

  2. #2
    Registered User
    Join Date
    04-07-2015
    Location
    Burnley, UK
    MS-Off Ver
    2013
    Posts
    19

    Re: Linking Cells from a Browsed For Workbook

    Hello,

    After quite a while messing about and trying parts of code from what people have put online. I managed to get something that works well enough for me.
    The code is below for anyone who wants to see:

    Sub SincDATA()
    Dim desPathName As Variant
    desPathName = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls*), *.xls*", Title:="Please select a file")
    If desPathName = False Then
    Exit Sub
    End If

    Dim answer As Integer
    answer = MsgBox("You are about to Sinc Data. Confirm?", vbYesNo + vbQuestion, "Confirm Sinc")
    If answer = vbYes Then

    Dim Path As String
    Path = desPathName

    Dim currentWb As Workbook
    Set currentWb = ThisWorkbook

    Dim openWb As Workbook
    Set openWb = Workbooks.Open(desPathName)

    currentWb.Sheets("User Interface").Range("C4") = openWb.Worksheets("Proposal Sign Off").Range("D2")
    +Plus many lines of linking cells
    currentWb.Sheets("User Interface").Range("L27") = openWb.Worksheets("Project Spec Sheet").Range("O53")

    ActiveWorkbook.Close

    End If
    End Sub

    Sorry its not in a code box. I haven't figured out how to add one yet.

    thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Two way linking of cells in multiple spreadsheets in same workbook using VBA
    By Azuak in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-30-2013, 08:12 AM
  2. [SOLVED] Linking cells in two worksheets in the same workbook
    By Steve1951 in forum Excel General
    Replies: 13
    Last Post: 06-13-2012, 08:25 PM
  3. Excel 2007 : Linking cells in a workbook
    By anio1424 in forum Excel General
    Replies: 1
    Last Post: 04-09-2012, 01:16 PM
  4. Linking cells from another workbook
    By albert28 in forum Excel General
    Replies: 2
    Last Post: 07-08-2010, 09:24 AM
  5. Linking cells from one workbook to another..
    By Lacetti in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-16-2008, 10:39 AM
  6. Linking cells to make it appear in other workbook
    By nikki115 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2008, 12:33 PM
  7. Problem about Linking cells to another workbook
    By Tricky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2005, 08:10 PM

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