+ Reply to Thread
Results 1 to 4 of 4

Auto running a macro when opening the spreadsheet

  1. #1
    Registered User
    Join Date
    07-25-2021
    Location
    Ireland
    MS-Off Ver
    365
    Posts
    25

    Auto running a macro when opening the spreadsheet

    Hi there,

    I've got a basic macro that updates the information on screen every second. How can I get it to run automatically when I open the spreadsheet?

    THis is what I currently have, which isn't working.

    Please Login or Register  to view this content.
    Thanks
    Last edited by AliGW; 04-11-2024 at 06:54 AM. Reason: Code tags added - please review the forum guidelines.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Auto running a macro when opening the spreadsheet

    To Add Excel VBA Code to a Workbook / This Workbook Module

    1. Copy the code that you want to use
    2. Select the workbook in which you want to store the code
    3. Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    4. In the Project Explorer, find your workbook, and open the list of Microsoft Excel Objects
    5. Right-click on the ThisWorkbook object, and choose View Code
    6. Where the cursor is flashing, choose Edit | Paste

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,234

    Re: Auto running a macro when opening the spreadsheet

    Quote Originally Posted by :) Sixthsense :) View Post
    Please Login or Register  to view this content.
    Rather:
    Please Login or Register  to view this content.
    If you would like to use an older type of code (Auto_Open) that runs when the workbook is opened, like this (in standard module, eg. Module1):
    Please Login or Register  to view this content.
    When you have more than one sheet in the workbook (and also when you have only one), you should indicate in which sheet you want to recalculate cell K8:
    Please Login or Register  to view this content.
    Artik

  4. #4
    Registered User
    Join Date
    07-25-2021
    Location
    Ireland
    MS-Off Ver
    365
    Posts
    25

    Re: Auto running a macro when opening the spreadsheet

    That's great, works perfectly. Thank you both.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Running Macro in Another Workbook without opening
    By PShingadia in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-04-2016, 06:29 AM
  2. Opening a 2nd Workbook and Running Macro
    By Geoff. in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2014, 06:17 PM
  3. [SOLVED] Auto open macro keeps opening spreadsheet
    By goldfield in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-18-2014, 10:29 AM
  4. How to auto-run code when opening spreadsheet.
    By rt1306 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2009, 03:34 PM
  5. How to auto-protect a spreadsheet when opening
    By PerplexedMel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2008, 02:52 PM
  6. Running a macro on opening a file
    By nieironisio in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2008, 10:08 AM
  7. Running macro upon opening workbook
    By don in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2006, 01:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1