Consulting

Results 1 to 3 of 3

Thread: Solved: Passing Worksheets

  1. #1
    VBAX Tutor
    Joined
    Oct 2007
    Posts
    210
    Location

    Solved: Passing Worksheets

    This is a mock example of what i am trying to do:
    [vba]Sub ReceiveProcedure(Log As Worksheets)
    MsgBox prompt:=Log.Range("A1")
    End Sub

    Sub PassWork()
    Set MySheet = Worksheets("Sheet1")
    ReceiveProcedure Log:=MySheet
    End Sub
    [/vba]

    What I am trying to do is create a class to handle different worksheets (defined when a new class is created). I need to pass that sheet to the class. How can I do that?
    Last edited by ProteanBeing; 01-30-2008 at 12:39 PM.
    "The amount of stupid people in the world is God's way of punishing the smart people" - protean_being

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub ReceiveProcedure(ByVal Log As Worksheet)
    MsgBox prompt:=Log.Range("A1")
    End Sub

    Sub PassWork()
    Set MySheet = Worksheets("Sheet1")
    ReceiveProcedure Log:=MySheet
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Oct 2007
    Posts
    210
    Location
    thanks
    "The amount of stupid people in the world is God's way of punishing the smart people" - protean_being

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •