LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 279
Default Msg Box Title

In message of Sat, 2 Mar 2013
01:33:02 in microsoft.public.excel.newusers, Gene Haines <Gene.Haines.b7
writes

Totally new to VBA. I have pasted a VBA code and was wondering how I
can
keep the MsgBox Title consistent throughout the VBA procedure. I have
the following code but when the ans = vbno, the MsgBox Title is
Microsoft Excel and not Metals Inventory Database. any help would be
greatly appreciated.


The OP might like to adapt what I show below AS I have adapted what he
has written.

Option Explicit ' All modules should start so to avoid some bugs


Private Function MIDMsg(ByVal Msg As String, Optional ByVal Config As Long = 0) As Long
Const Title As String = "Metals Inventory Database"

MIDMsg = MsgBox(Msg, Config, Title)
End Function

Public Sub foo()
Dim Msg As String

If True Then
Msg = "You owe a balance due to Virginia at this time!" & _
vbLf & vbLf & _
"Would you like to fufill that obligation" & _
" with an Funds Transfer?"
' Brackets in call statements seem odd to me
If MIDMsg(Msg, vbYesNo + vbQuestion) = vbYes Then
' Use call if you really want to have brackets
Call Workbooks.Open("C:\Documents and Settings\MyFolder\My Documents\TestII.xlsx")
Else
' Or leave them out for textual economy.
MIDMsg "Then please do a Journal Voucher. Thank you."
End If
Else
' I have corrected a slip.
MIDMsg "No B[a]lance Owed"
End If

End Sub

Thank you


You're welcome. I found your problem entertaining.
N.B. my long lines may wrap in an unfriendly way.
--
Walter Briscoe
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to hide a chart title, but keep the title in the chart KBratt Charts and Charting in Excel 1 July 16th 09 12:13 AM
Named range=Column title,comumn title in cellB6 use B6in equation Graham Excel Discussion (Misc queries) 2 July 21st 06 10:03 AM
Show full path title in title bar? Nor New Users to Excel 4 November 4th 05 06:00 PM
Pasting Objects into Chart title and Axis title Sam Charts and Charting in Excel 1 June 6th 05 08:50 PM
VB msg box - can it have a title? StargateFan[_3_] Excel Programming 4 February 3rd 05 02:43 AM


All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"