ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Display Current File Name in MsgBox (https://www.excelbanter.com/excel-programming/283664-display-current-file-name-msgbox.html)

Paul Moles[_2_]

Display Current File Name in MsgBox
 
It must be simple but I can't find how to display the
current filename in a message box, preceded by a piece of
text. eg. MsgBox

Cleared workbook has been saved as current filename.

The file has already been saved so the current filename is
available.

MsgBox Application.ActiveWorkbook.name gives the current
filename but I cannot find how to precede the name with a
meaningful message.

Many Thanks
Paul

Tim Marsh[_2_]

Display Current File Name in MsgBox
 
never replied to a post before, so i hope i get this right: -

to include preceeding text, use concatenation, ie,

MsgBox "Some Text " & Application.ActiveWorkbook.name

"Paul Moles" wrote in message
...
It must be simple but I can't find how to display the
current filename in a message box, preceded by a piece of
text. eg. MsgBox

Cleared workbook has been saved as current filename.

The file has already been saved so the current filename is
available.

MsgBox Application.ActiveWorkbook.name gives the current
filename but I cannot find how to precede the name with a
meaningful message.

Many Thanks
Paul




patrick molloy

Display Current File Name in MsgBox
 
dim title as string
dim msg as string

title = "File Loaded"
msg = "The following workbook is saved" & vbcr & vbcr
msg = msg & ActiveWorkbook.name

msgbox msg,,title

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
It must be simple but I can't find how to display the
current filename in a message box, preceded by a piece

of
text. eg. MsgBox

Cleared workbook has been saved as current filename.

The file has already been saved so the current filename

is
available.

MsgBox Application.ActiveWorkbook.name gives the current
filename but I cannot find how to precede the name with

a
meaningful message.

Many Thanks
Paul
.


Paul Moles[_2_]

Display Current File Name in MsgBox
 
Thanks Tim,
-----Original Message-----
never replied to a post before, so i hope i get this

right: -

to include preceeding text, use concatenation, ie,

MsgBox "Some Text " & Application.ActiveWorkbook.name

"Paul Moles" wrote

in message
...
It must be simple but I can't find how to display the
current filename in a message box, preceded by a piece

of
text. eg. MsgBox

Cleared workbook has been saved as current filename.

The file has already been saved so the current filename

is
available.

MsgBox Application.ActiveWorkbook.name gives the current
filename but I cannot find how to precede the name with

a
meaningful message.

Many Thanks
Paul



.


No Name

Display Current File Name in MsgBox
 
sCurrentFileName = Application.ActiveWorkbook.name
sMeaningFullText="The Current Filename
is "&sCurrentFileName
Msgbox sMeaningFullText

Lars Kofod

-----Original Message-----
It must be simple but I can't find how to display the
current filename in a message box, preceded by a piece

of
text. eg. MsgBox

Cleared workbook has been saved as current filename.

The file has already been saved so the current filename

is
available.

MsgBox Application.ActiveWorkbook.name gives the current
filename but I cannot find how to precede the name with

a
meaningful message.

Many Thanks
Paul
.



All times are GMT +1. The time now is 08:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com