ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open a workbook listed in a different worksheet (hope this is clearer!) (https://www.excelbanter.com/excel-programming/308883-open-workbook-listed-different-worksheet-hope-clearer.html)

nickyboy[_2_]

Open a workbook listed in a different worksheet (hope this is clearer!)
 
Hi,

I will try to explain my problem.

I have one workbook (A) with 200 columns, each column headed with th
address of different workbook. The rows underneath containin
numerical data.

The data in each column is in 200 other seperate workbooks. I woul
like to check that the numbers in workbook A matches that in the 20
files.

I tried to make a macro copy and paste the address from each colum
into the bar at the top, opening the corresponding workbook so I ca
take a number from cell D28 back to the original workbook to check i
is the same.

I have attached the macro below.

' Macro recorded 03/09/2004 by nick

Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWorkbook.FollowHyperlink Address:= _
"P:\\Data2\peer1-branch-1.xls" _
, NewWindow:=False, AddHistory:=True
ActiveWindow.ScrollRow = 25
ActiveWindow.SmallScroll Down:=-3
Range("D28").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.WindowState = xlMinimized
Range("B4").Select
ActiveSheet.Paste
Columns("B:B").Select
Application.CutCopyMode = False
Selection.Cut
ActiveWindow.ScrollColumn = 242
Columns("IU:IU").Select
Selection.Insert Shift:=xlToRight
End Sub

As you can see, this obviously opens "P:\\Data2\peer1-branch-1.xls
everytime. Is there a way I can open whatever address is in cell B2?

I hope it is clearer this time, if not, please let me know.

Thanks,
Nic

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 05:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com