+ Reply to Thread
Results 1 to 5 of 5

Where are these written?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-16-2015
    Location
    Istanbul
    MS-Off Ver
    Office 365
    Posts
    928

    Where are these written?

    1) The code of the UserForm

    2) The code which make a UserForm display

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Where are these written?

    1) double click any object in the userform

    2) the general syntax is UserForm1.Show

    you can type that into the immediate window, or trigger it from another event, like pressing a button on your sheet, or double clicking a certain cell, or any number of other events.

  3. #3
    Forum Contributor
    Join Date
    01-16-2015
    Location
    Istanbul
    MS-Off Ver
    Office 365
    Posts
    928

    Re: Where are these written?

    1) When I make

    Developer - Controls - Insert - Form Controls - (Select A Form Control) - (Then Paste It To The Spreadsheet) - (Then double click the control)

    Nothing happens

    however I make

    Developer - Controls - Insert - ActiveX Controls - (Select A ActiveX Control) - (Then Paste It To The Spreadsheet) - (Then double click the control)

    Code Screen Opens

    So how do I create a code for a button on the spreadsheet?

    2) What I ask is where do I write that?

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Where are these written?

    For the "FORMS CONTROL" button, first write the code in a standard module. Then right click the button and select "assign Macro"...
    Ben Van Johnson

  5. #5
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Where are these written?

    1) If you're using a form control, right click the button and select "Assign Macro". Select the macro that you want to execute when the button is pressed. This of course mandates that you already have a sub written, or at least a sub defined.

    If you're using an ActiveX control, the steps you described are correct. The "code screen" should display a sub like "Private Sub CommandButton1_Click()" (or whatever your button is named. This is where your code goes.

    2) I hope I've answered this question in my previous paragraphs.

+ 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. [SOLVED] How do I use a name when the name is written in a cell?
    By annabroyn in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-31-2014, 10:02 AM
  2. Pre-written formula
    By Newton1234 in forum Excel General
    Replies: 2
    Last Post: 06-05-2008, 04:51 AM
  3. Written values
    By jam in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-31-2006, 07:58 AM
  4. xla written in C#
    By Torben Laursen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-04-2005, 04: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