Results 1 to 5 of 5

Run code each time form is opened

Threaded View

  1. #1
    Registered User
    Join Date
    06-26-2014
    Location
    Boston, MA
    MS-Off Ver
    Office 365
    Posts
    11

    Run code each time form is opened

    Hey everyone,
    The problem i'm need help on is that I have a every time this form opens (ResourceForm) I need the following code to run to flip the checkbox value. This works when adding the code to a button but not for when the form loads. I feel like there's something incredibly simple that i'm missing and initialize doesn't seem to be the answer as i'll be opening this form many times. Any help would be greatly appreciated!

    User flow:
    If the selected text appears in the cell when the form is opened the corresponding checkbox will be true.


    Public Sub ResourceForm_Activate() 
        Dim celltxt As String
        celltxt = ActiveSheet.Range("E9").Value
        If InStr(celltxt, "SSS1B", vbTextCompare) Then
            CheckBox1.Value = True
        Else
            CheckBox1.Value = False
        End If
    End Sub
    InsertResource_Test.xlsm
    Last edited by brandonboucher; 07-01-2014 at 01:28 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to set a Global Macros so that it gets opened every time an excel file is opened?
    By pericopericone in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2013, 05:53 AM
  2. [SOLVED] VBA Code open files in folder, copy text to workbook-Next time folder opened copy only new
    By Bikeman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2013, 07:59 PM
  3. Loading a user form crashes Excel 2003 -- the second time it's opened
    By Bob Eaton in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2012, 07:19 PM
  4. Access - run code once form is opened
    By adgjqetuo in forum Access Programming / VBA / Macros
    Replies: 3
    Last Post: 12-07-2010, 02:54 AM
  5. [SOLVED] how can I make a form number change everytime the form is opened
    By babydumplingspita in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-10-2005, 03:05 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