+ Reply to Thread
Results 1 to 5 of 5

Function to Delete Procedure - or - Convert Procedure to Function?

  1. #1
    Forum Contributor
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    100

    Function to Delete Procedure - or - Convert Procedure to Function?

    Hello,
    I must first preface this with I am not a programmer, but I try.

    I’m looking for an Excel function to delete a procedure(s). I found a procedure on line that does this (I wish I could find it again and give the author credit). However, since it is written to delete only one specific procedure – I have more than one. Is it possible to convert the Sub into a Function?

    Here is the existing Sub Procedure:

    Please Login or Register  to view this content.
    Thanks for viewing,
    Steve K.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,107

    Re: Function to Delete Procedure - or - Convert Procedure to Function?

    Is it possible to convert the Sub into a Function?
    It's already a subroutine. You just need to put it in a loop and pass it an array of procedures to delete.

    A Function returns a value so would not be appropriate here, I don't think anyway.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    100

    Re: Function to Delete Procedure - or - Convert Procedure to Function?

    Thanks Trevor for your quick response. I’m probably using the wrong terminology.

    I’m looking for something similar to the following function that checks if a procedure exists. I use this function in another routine that checks if the procedure exists; if it does I do something.

    What I had in mind is I’d like some function to delete a subroutine based on the parameter entered after the function. Let’s say the function is called DeleteEm() and the subroutine I want to delete is called TryMe. Then the syntax would be something like: DeleteEm(“TryMe”).


    Here is the existing function that checks if a procedure exists:
    Please Login or Register  to view this content.

    Here is my TEST1 routine to do something if the procedure TryMe exists:
    Please Login or Register  to view this content.

    Thanks again,
    Steve
    Last edited by esskaykay; 06-02-2024 at 02:40 PM.

  4. #4
    Forum Contributor
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    100

    Re: Function to Delete Procedure - or - Convert Procedure to Function?

    Got it - Solved. . .

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Function to Delete Procedure - or - Convert Procedure to Function?

    Here for those who may be interested.
    Everyone who confuses correlation and causation ends up dead.

+ 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. Excel VBA or any free tool for list all VBA function procedure and Sub Procedure
    By bennyys in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2017, 02:03 AM
  2. Calling Procedure or Function inside another Procedure - variables problem
    By Rudo123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2015, 03:12 PM
  3. Sub procedure within a function
    By newbielondon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2012, 10:50 AM
  4. Convert procedure into function
    By jeffreybrown in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-31-2011, 11:15 AM
  5. Calling a Function in a Procedure
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-02-2010, 02:38 PM
  6. Function Procedure Help
    By drun in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2006, 05:25 PM
  7. how to call a function procedure
    By nathan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-17-2006, 03:00 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