help with leaving message please

picto

New Member
Joined
Apr 16, 2009
Messages
7
one of my collegues is leaving for a new job. Tom is the VBA guru in or office and we thought it would be fun to say goodbye and goodluck in VBA code printed on a Tshirt.

something like:

Sub goodbye
IF workload = 0 THEN GOTO newjob ELSE...
End Sub

Any Ideas folks.

Thanks in advance
Shaun
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Here is something simple, though I imagine some folks here will come up with something much more clever than this.

Code:
Sub GoodByeAndGoodLuck()
 
    Dim GoToNewJob as Boolean
    Dim GetBackToWork as Boolean 
    Dim WillBeBlamedForAllErrors as Boolean
 
    If Workload=0 Then
        GoToNewJob=TRUE
        WillBeBlamedForAllErrors=TRUE
    Else
        GetBackToWork=TRUE
    End If
 
End Sub
 
Sacrificing compilability (is that a word?) for humour something like:

Code:
Sub GoodByeAndGoodLuck()
    Dim In_Right_Now As Date
    Dim OldColleague As Variant
    Dim PlaceOfWork As Object
    Dim VBAProblems As Boolean
    
    For Each OldColleague In PlaceOfWork
        If VBAProblems = False Then
        Debug.Print "Goodbye and good luck!"
        Else
        Call TomPleaseFixThis(Now As In_Right_Now)
    Next
End Sub
 
Sacrificing compilability (is that a word?) for humour something like:

Code:
Sub GoodByeAndGoodLuck()
    Dim In_Right_Now As Date
    Dim OldColleague As Variant
    Dim PlaceOfWork As Object
    Dim VBAProblems As Boolean
 
    For Each OldColleague In PlaceOfWork
        If VBAProblems = False Then
        Debug.Print "Goodbye and good luck!"
        Else
        Call TomPleaseFixThis(Now As In_Right_Now)
    Next
End Sub

Very good :biggrin:
You need to close your If statement though :stickouttounge:
 
provided we have an OldColleague Class:

Code:
Function Goodbye_and_goodluck() As String
Dim OldColleague As Person
Dim OldPlace As Object
For Each OldColleague In OldPlace
    If OldColleague.HasVbaTroubles Then
        Goodbye_and_goodluck = "Thats a fine mess you made Tom"
    Else
        Goodbye_and_goodluck "Goodby and good luck"
    End If
Next OldColleague
End Function
 
Code:
Sub Goodbye()
On Error GoTo Handler:

Msgbox "We'll miss you!"

Handler:
Call Tom

End Sub
 
Might need a big t-shirt but:

Code:
Sub ByeByeTom()

Dim LeavingPresentFund As Double, ****Ups As Boolean, Project As Range, ****up_Total As Long

LeavingPresentFund = InputBox("How much did you get for Tom's leaving collection?")

For Each Project In Range("Tom's_Projects")
    If IsError(Project) Then
        ****Ups = True
        ****up_Total = ****up_Total + 10
    End If
Next Project
        
If ****Ups = True Then
    MsgBox "Forget the reference Tom! You got " & Format(LeavingPresentFund, "£#,##0.00") & " from us!" _
        & vbLf & "Kindly return " & Format(****up_Total, "£#,##0.00"), vbCritical
Else
    MsgBox "Good luck in your future career Tom!!!" & _
        "Enjoy spending the " & Format(LeavingPresentFund, "£#,##0.00"), vbExclamation
End If

End Sub

Dom
 
Dom

Can you help me with some code?
Code:
For Each Project In Range("Tom's_Projects")
I get some kind of strange error.
Code:
Method 'Range' of object '_Global' failed
Perhaps Tom can help.:)

PS Could we have error tags as well as code tags?

No practical reason, just thought it might make posts prettier.:)
 
Maybe he's going to work abroad and can't be contacted ;-)

Dom
 

Forum statistics

Threads
1,222,642
Messages
6,167,267
Members
452,107
Latest member
cami_dev

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top