ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   auto start code when a sheet is looked at (https://www.excelbanter.com/excel-programming/403884-auto-start-code-when-sheet-looked.html)

Southern at Heart

auto start code when a sheet is looked at
 
Can I have my code (that updates data on sheet("Materials") to automatically
activate when the user selects that tab in the list of sheets?
I tried this:
Sub Worksheet_Activate()
Update_Materials
End Sub

where Update_Materials is the sub to do the work, but nothing happens when I
flip between sheets...


Nick Hodge[_2_]

auto start code when a sheet is looked at
 
Try specifically calling it

Sub Worksheet_Activate()
Call Update_Materials
End Sub
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk




"Southern at Heart" wrote in
message ...
Can I have my code (that updates data on sheet("Materials") to
automatically
activate when the user selects that tab in the list of sheets?
I tried this:
Sub Worksheet_Activate()
Update_Materials
End Sub

where Update_Materials is the sub to do the work, but nothing happens when
I
flip between sheets...



All times are GMT +1. The time now is 01:48 AM.

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