I'm trying to set up two folders; one group and one individual. The
individual folder needs to link back to it's corresponding worksheet in
another workbook/folder. Is there a way to do this without having to
fomulate each cell individually? (We're talking about 35-40 pages). Thanks
for any/all suggestions
Hi
This is just a suggestion on how to start as I'm not sure if I
understand correctly (what do you mean by quot;foldersquot;?), but try...
For multiple files:
1)
Creating a list of the file names that you want the links to go to.
Have a look at:
www.erlandsendata.no/english/...ldersscripting
2)
Using the indirect function to build the reference to the cell you want
to link to (check out the Excel help files) amp; pasting it down alongside
the list of file names.
Or for a single file with multiple sheets:
1)
Creating a list of sheet names that you want the links to refer to.
For this I use the macro below:
Code:
--------------------
Sub ListOfSheetNames()
'This macro is adapted from www.j-walk.com/ss/excel/tips/tip81.htm
Dim UserRange As Range
Dim output As String
Dim prompt As String
Dim title As String
Dim i As Integer
output = quot;List Of Sheet Namesquot;
prompt = quot;Please select a cell ON THIS SHEET where you want a vertical list quot; _
amp; quot;of the sheet names in the workbook to be placed.quot; _
amp; quot;If you are not on the sheet you want the list on, please quot; _
amp; quot;cancel this message box and select the sheet you want before rerunnning the macro.quot;
title = quot;SELECT CELL FOR BEGINNING LIST IN.quot;
' Display the Input Box
On Error Resume Next
Set UserRange = Application.InputBox(prompt:=prompt, title:=title, _
Type:=8) 'Range selection
' Was the Input Box cancelled?
If UserRange Is Nothing Then
MsgBox quot;Macro cancelled, exiting macro without creating list of sheet names.quot;
Application.ScreenUpdating = True
Exit Sub
Else
End If
'To format Header cell.
With UserRange
.Range(quot;A1quot;) = output
.Font.FontStyle = quot;Boldquot;
End With
For i = 1 To Sheets.Count
UserRange.Offset(i, 0).Value = Sheets(i).Name
Next i
'UserRange.Select
Application.ScreenUpdating = True
MsgBox quot;Listing of the sheet names for the quot; amp; Sheets.Count amp; quot; in this workbook is complete.quot;, vbInformation, quot;LIST IS COMPLETEquot;
End Sub
--------------------
2)
Using the indirect function to build the reference to the cell you want
to link to (check out the Excel help files) amp; pasting it down alongside
the list of sheet names.hth
Rob Brockett
NZ
Always learning amp; the best way to learn is to experience...--
broro183
------------------------------------------------------------------------
broro183's Profile: www.excelforum.com/member.php...oamp;userid=30068
View this thread: www.excelforum.com/showthread...hreadid=521353
- Dec 18 Thu 2008 20:48
Link individual sheet to one sheet in another workbook
close
全站熱搜
留言列表
發表留言