+ Reply to Thread
Results 1 to 4 of 4

Opening A Workbook Then Run Code

  1. #1
    Registered User
    Join Date
    03-23-2010
    Location
    Melbourne Australia Down Under
    MS-Off Ver
    Excel 2010
    Posts
    56

    Opening A Workbook Then Run Code

    Hi

    I seek assistance with running the code shown below when I open a workbook. I have attached a copy of the workbook.

    The code below is in the following cells as a function.

    Sheet HMD Budget cell J2
    Sheet HMD Accounts cell D6
    Sheet HMD Staff cells L6, N6, N7 and N11

    Please Login or Register  to view this content.
    I have tried several ways but cannot get this to work?

    It may not be possible?
    Attached Files Attached Files
    Last edited by kapeller; 12-29-2012 at 08:24 PM.
    Have a great day!!!!

    Lou

  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    907

    Re: Opening A Workbook Then Run Code

    If you change your Workbook_Open to:
    Please Login or Register  to view this content.
    you will manage to update at least one calculated cell every time you open the file. Just link the others to it.
    Surely it's not the best way but it works .

  3. #3
    Registered User
    Join Date
    03-23-2010
    Location
    Melbourne Australia Down Under
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Opening A Workbook Then Run Code

    Hi rollis13

    Many thanks for your help

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Opening A Workbook Then Run Code

    Hi,

    Please take this as constructive criticism. Aren't you rather overcomplicating the whole thing.

    On the face of it I can see no need for VBA functions when there are perfectly good Excel standard functions available. And if you want to be formatting cells in different ways according to values elsewhere then use Conditional Formatting. Don't try and reinvent the wheel with VBA.

    As a general principle always use standard Excel functionality as the first choice and only revert to VBA when there are things only it can do for you.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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