+ Reply to Thread
Results 1 to 2 of 2

Possible to run a sub in another sheet that uses a function & have it run in the caller?

Hybrid View

  1. #1
    Registered User
    Join Date
    08-04-2010
    Location
    United States
    MS-Off Ver
    Office 365 for windows
    Posts
    62

    Unhappy Possible to run a sub in another sheet that uses a function & have it run in the caller?

    Hello.

    In Sheet2 (Named Shift_One) I have a Public Sub named verifyCells()

    It has a lot of calls to a function in the same sheet that are formatted this way:

    cellNotEmpty Range("B1")
    cellNotEmpty Range("B3")
    This is my public function:

    Public Function cellNotEmpty(rngT As Range)
        If IsEmpty(rngT) Then
            MsgBox (rngT.Address & " Cannot Be Blank")
        End If
    End Function
    In Sheet3 (Named Shift_Two) I have the following code:

    Sub SaveShiftTwoReport()
        Worksheets("Shift_Two").Select    
        Sheet2.verifyCells
    Is it possible to call the verifyCells function on Sheet2 and run cellNotEmpty Range("B1") from Sheet3 but have it check Sheet3's cells for blanks instead of running it on sheet2?

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,661

    Re: Possible to run a sub in another sheet that uses a function & have it run in the calle

    Wrong sub-forum box!
    Sen a message to Admin to ask for moving to VBA/Code to get more helps.
    Quang PT

+ 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. Caller ID for Excel Database
    By Lippa73 in forum Excel General
    Replies: 0
    Last Post: 10-22-2012, 01:55 PM
  2. How to notify a function's caller of a condition.
    By david90 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2012, 07:12 PM
  3. App.Caller for CommandBarControl
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2011, 12:29 PM
  4. Reference worksheet by index, how to make function use values from caller sheet
    By quasimoto in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2011, 04:48 PM
  5. Telephone Caller ID in Excel
    By OptionTrader in forum Excel General
    Replies: 1
    Last Post: 11-01-2009, 12:44 PM
  6. [SOLVED] application caller
    By Rich in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-24-2006, 07:35 AM
  7. [SOLVED] Application.Caller
    By Marcelo in forum Excel General
    Replies: 6
    Last Post: 06-23-2006, 10:10 AM
  8. Row = Application.Caller.Row
    By Charles Woll in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-28-2005, 10:06 AM

Tags for this Thread

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