Multiple files

tintin1012000

Board Regular
Joined
Apr 27, 2011
Messages
237
HI all,

Using VBA

I want to create an excel sheet where a supervisor can monitor 4 excel files,
The 4 files to monitor are in 4 different folders
C:\Documents and Settings\dave01\My Documents\Line 1
C:\Documents and Settings\dave01\My Documents\Line 2
C:\Documents and Settings\dave01\My Documents\Line 3
C:\Documents and Settings\dave01\My Documents\Line 4

In the line folders there are workbooks called wk18, wk19 wk 20 etc depending on the week !!

Ideally the excel document would ask the user for the week number and in turn it would open a specific location within the workbook,

Can anyone help
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Something like this:


Code:
Sub test()

Dim strWeekNum As String

strWeekNum = InputBox("Enter week number")

If strWeekNum = "" Then Exit Sub

Workbooks.Open "C:\Documents and Settings\dave01\My Documents\Line 1\wk" & strWeekNum & ".xls"
Workbooks.Open "C:\Documents and Settings\dave01\My Documents\Line 2\wk" & strWeekNum & ".xls"
Workbooks.Open "C:\Documents and Settings\dave01\My Documents\Line 3\wk" & strWeekNum & ".xls"
Workbooks.Open "C:\Documents and Settings\dave01\My Documents\Line 4\wk" & strWeekNum & ".xls"

End Sub

Dom
 
Upvote 0
Thanks for the quick reply Dom,

It works almost perfect, The file will open using your code but I want to go to a specific location within the sheet depending on the shift eg
Monday Days i want to go to sheet called Graphs A1
Monday Nights ----- Graphs A139
Tuesday Days ------ Graphs A277
Tuesday NIght ------Graphs A415

If there was a drop down menu with all the shifts it would be ideal

Rich
 
Upvote 0
To have a dropdown you would need to create a userform to display as a normal inputbox doesn't have that functionality.

Dom
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,544
Members
452,925
Latest member
duyvmex

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top