Auto Scroll Separate Files

jarett

Board Regular
Joined
Apr 12, 2021
Messages
179
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I am setting up a TV screen that is hooked up to a laptop (HDMI), I have 4-5 separate Excel files that I would like to display on the tv screen. The files are not live and will just refresh through out the day. I know I can adjust the size and have all of them open on the same screen but, I was looking for a way to have each one open at maximum screen size and basically toggle/scroll to each file every minute or so. Is this possible or do I need some third party software add on?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
You could try something like this:
VBA Code:
Private Sub rotatesheets()

restartloop:
Workbooks("Workbook1-Name.xlsm").Activate
Application.Wait (Now + TimeValue("00:01:00"))

Workbooks("workbook2-name.xlsm").Activate
Application.Wait (Now + TimeValue("00:01:00"))

GoTo restartloop
End Sub

To exit the loop, hold the ESC key.
 
Upvote 0
You could try something like this:
VBA Code:
Private Sub rotatesheets()

restartloop:
Workbooks("Workbook1-Name.xlsm").Activate
Application.Wait (Now + TimeValue("00:01:00"))

Workbooks("workbook2-name.xlsm").Activate
Application.Wait (Now + TimeValue("00:01:00"))

GoTo restartloop
End Sub

To exit the loop, hold the ESC key.
Might be a dumb question, but not proficient in VBA, do I have to enter this into each worksheet or just one worksheet?
 
Upvote 0
You can create an entirely different workbook for this script if you like. As long as the spreadsheets are all open and you have typed the filenames correctly, it should work. You could take it a step further and have this workbook open all of your required spreadsheets as well.
 
Upvote 0
Here's an example. If you create a new workbook and list all of your workbook filenames in column A, this script will open each of them, make them fullscreen and then rotate them. I haven't tested this yet...but I believe I have the syntax correct.

VBA Code:
Private Sub rotatesheets()
Dim lrow As Long
lrow = Sheet1.Cells.Find("*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row

'open sheets listed in column A on Sheet1
For x = 1 To lrow
Workbooks.Open Sheet1.Range("A" & x).Value
ActiveWindow.WindowState = xlMaximized
Next x

'start rotating sheets
restartloop:
For x = 1 To lrow
Workbooks("A" & x).Activate
Application.Wait (Now + TimeValue("00:01:00"))
Next x

GoTo restartloop
End Sub
 
Upvote 0
Here's an example. If you create a new workbook and list all of your workbook filenames in column A, this script will open each of them, make them fullscreen and then rotate them. I haven't tested this yet...but I believe I have the syntax correct.

VBA Code:
Private Sub rotatesheets()
Dim lrow As Long
lrow = Sheet1.Cells.Find("*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row

'open sheets listed in column A on Sheet1
For x = 1 To lrow
Workbooks.Open Sheet1.Range("A" & x).Value
ActiveWindow.WindowState = xlMaximized
Next x

'start rotating sheets
restartloop:
For x = 1 To lrow
Workbooks("A" & x).Activate
Application.Wait (Now + TimeValue("00:01:00"))
Next x

GoTo restartloop
End Sub
Ok, tried the code and received a runtime error on the first file name. I forgot to mention these are network files, I am trying to list the file names in column A a couple different ways to see if I can manually access them through the new worksheet but every way says, "cannot open the specified file". These are the two file format names I tried, L is the drive letter and that drive is named "Internal";
L:\Internal\Warehouse and Gen Inventory\Inventory_Quality_Control_Log.xlsx
\\Internal\Warehouse and Gen Inventory\Inventory_Average.xlsx

I attempted saving the VBA workbook on the laptop and also tried running it on my pc.

 
Upvote 0
Assuming \\internal references a specific server. Either of those formats should work. In column A if you click on one of the links will it open the file?
 
Upvote 0
Otherwise you can try \\servername\internal\… depending on your network structure.
 
Upvote 0
But long story short if it doesn’t open the file by clicking the link you added then it won’t open with the script either.
 
Upvote 0
had to name the server in the file link, got all the files to open manually in the scroll.xlsx file. Ran VBA and got this error and it stated this part of the code as the error; "Workbooks("A" & x).Activate"
1719002220149.png
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,189
Members
452,616
Latest member
intern444

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