Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Linking to user specified file
I want to link cell A1 in workbook1 to more than one workbook. I
actually want a procedure to ask the user to specify which workbook to link to. How can I do this? Can I automate this so that the user specifies the file and updates cells ? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Linking to user specified file
Sub CreateLink()
Dim rng as Range, bk as Workbook Dim fName as Variant set rng = activecell.parent.Range("A1") fname = application.GetOpenFileName() if fName = False then exit sub set bk = workbooks.open(fName) bk.Worksheets(1).Range("A1").Formula = "=" & _ rng.Address(1,1,xlA1,True) bk.Close Savechanges:=True End Sub -- Regards, Tom Ogilvy " wrote: I want to link cell A1 in workbook1 to more than one workbook. I actually want a procedure to ask the user to specify which workbook to link to. How can I do this? Can I automate this so that the user specifies the file and updates cells ? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Linking to user specified file
Could you tell me what exactly this code is doing ? I am not sure if I
am getting the desired result.. On Feb 7, 11:27 am, Tom Ogilvy wrote: Sub CreateLink() Dim rng as Range, bk as Workbook Dim fName as Variant set rng = activecell.parent.Range("A1") fname = application.GetOpenFileName() if fName = False then exit sub set bk = workbooks.open(fName) bk.Worksheets(1).Range("A1").Formula = "=" & _ rng.Address(1,1,xlA1,True) bk.Close Savechanges:=True End Sub -- Regards, Tom Ogilvy " wrote: I want to link cell A1 in workbook1 to more than one workbook. I actually want a procedure to ask the user to specify which workbook to link to. How can I do this? Can I automate this so that the user specifies the file and updates cells ?- Hide quoted text - - Show quoted text - |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Linking to user specified file
it creates a link from the workbook selected by the user back to A1 of the
activesheet when you run the macro. the link is established in cell A1 of the first sheet in the workbook specified. I want to link cell A1 in workbook1 to more than one workbook. so your Workbook1 should be the activeworkbook when you run the macro. -- Regards, Tom Ogilvy " wrote: Could you tell me what exactly this code is doing ? I am not sure if I am getting the desired result.. On Feb 7, 11:27 am, Tom Ogilvy wrote: Sub CreateLink() Dim rng as Range, bk as Workbook Dim fName as Variant set rng = activecell.parent.Range("A1") fname = application.GetOpenFileName() if fName = False then exit sub set bk = workbooks.open(fName) bk.Worksheets(1).Range("A1").Formula = "=" & _ rng.Address(1,1,xlA1,True) bk.Close Savechanges:=True End Sub -- Regards, Tom Ogilvy " wrote: I want to link cell A1 in workbook1 to more than one workbook. I actually want a procedure to ask the user to specify which workbook to link to. How can I do this? Can I automate this so that the user specifies the file and updates cells ?- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Linking to file, some formulas work only if file is open | Links and Linking in Excel | |||
Linking to another file using file reference typed cell | Excel Worksheet Functions | |||
linking multiple roles (rows) to a user (cell) | Excel Discussion (Misc queries) | |||
Linking multiple scripts by user OK | Excel Programming | |||
Turning a text file name into a search and linking the file as a hyperlink | Excel Discussion (Misc queries) |