+ Reply to Thread
Results 1 to 3 of 3

Calling a subroutine when user selects value in Data Validation List

  1. #1
    Forum Contributor michellepace's Avatar
    Join Date
    10-28-2015
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    132

    Question Calling a subroutine when user selects value in Data Validation List

    Hi,

    I have found out how to call a macro when my user selects a yes/no value from my drop downlist. However, what I am worried about is the hard coding of "F3" in my code... If someone happens to insert a row above, my code will no longer work. The cell containing the drop down, F3, is called "geared_slew".

    Question 1:
    Is there another way of coding this functionality so that my code is not so "breakable"?

    Question 2:
    I don't want to call a macro. Rather I want to write a subroutine. How can I modify my code to rather call a subroutne called "setGearDataToNotApplicable" ?

    SCREENSHOT1.jpg


    Thanks
    Michelle

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Calling a subroutine when user selects value in Data Validation List

    Hi,

    1. Yes, just replace Range("F3") with range("geared_slew")

    2. A macro and subroutine are the same thing (unless you wrote an XLM macro) so simply replace macro1 with setGearDataToNotApplicable.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor michellepace's Avatar
    Join Date
    10-28-2015
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    132

    Re: Calling a subroutine when user selects value in Data Validation List

    Thank-you xlnitwit - solved!

+ 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. Determining which subroutine is calling another subroutine?
    By jplank in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2016, 01:05 PM
  2. Replies: 10
    Last Post: 05-30-2015, 01:33 PM
  3. Calling macro from change in Data Validation List
    By DavidBW in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-28-2014, 01:43 AM
  4. [SOLVED] Input Box User Selects Data
    By basketball2524 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-21-2013, 06:46 PM
  5. Calling a Subroutine (2)
    By Configurator in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2007, 06:52 PM
  6. [SOLVED] Start Macro after user selects a choice from a pick list
    By Mathew in forum Excel General
    Replies: 2
    Last Post: 08-17-2006, 10:30 AM
  7. [SOLVED] Is this possible...Filter list after user selects location
    By Jan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-31-2005, 04:06 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