#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default MsgBox

rather than tinker around for hours trying to figure how
to get this expression to work, i was hoping that someone
with more experience could show me how its done. I want
the message to say "Found files blah blah blah...:" then
list each file it found below, each file found getting
its own line in the msgbox. my method below has multiple
syntax errors that i havnt been able to get around:

MsgBox("Found File '" & .Filename & "' with "
& .FoundFiles.Count & " file(s) in it." & Chr(10) & _
For i = 1 To .FoundFiles.Count
.FoundFiles (i) & Chr(10)
Next i & _
Chr(10) & "Would you like to save in the file?",
vbYesNoCancel + vbExclamation, "Existing File Found")

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default MsgBox

sMsg = ""
For i = 1 To .FoundFiles.Count
sMsg = .FoundFiles (i) & vbcrlf
Next i

ans = MsgBox (.FoundFiles.Count & " file(s) found." & Chr(10) & _
sMsg & _
"Would you like to save in the file?", _
vbYesNoCancel + vbExclamation, "Existing File
Found")

If ans = vbYes Then
' etc.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Lawson" wrote in message
...
rather than tinker around for hours trying to figure how
to get this expression to work, i was hoping that someone
with more experience could show me how its done. I want
the message to say "Found files blah blah blah...:" then
list each file it found below, each file found getting
its own line in the msgbox. my method below has multiple
syntax errors that i havnt been able to get around:

MsgBox("Found File '" & .Filename & "' with "
& .FoundFiles.Count & " file(s) in it." & Chr(10) & _
For i = 1 To .FoundFiles.Count
.FoundFiles (i) & Chr(10)
Next i & _
Chr(10) & "Would you like to save in the file?",
vbYesNoCancel + vbExclamation, "Existing File Found")



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default MsgBox

DIM msg As String
For i = 1 To .FoundFiles.Count
msg = msg & vbcr &.FoundFiles (i)
Next i

msg = "Found: & vbcr & msg

If msgbox( msg, vbYesNo, "Save Found Files?" ) = vbYes Then
' you code here...
End If


Patrick Molloy
Microsoft Excel MVP

"Lawson" wrote in message
...
rather than tinker around for hours trying to figure how
to get this expression to work, i was hoping that someone
with more experience could show me how its done. I want
the message to say "Found files blah blah blah...:" then
list each file it found below, each file found getting
its own line in the msgbox. my method below has multiple
syntax errors that i havnt been able to get around:

MsgBox("Found File '" & .Filename & "' with "
& .FoundFiles.Count & " file(s) in it." & Chr(10) & _
For i = 1 To .FoundFiles.Count
.FoundFiles (i) & Chr(10)
Next i & _
Chr(10) & "Would you like to save in the file?",
vbYesNoCancel + vbExclamation, "Existing File Found")



Reply
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
msgbox muddan madhu Excel Worksheet Functions 2 April 14th 08 05:06 AM
msgbox flow23 Excel Discussion (Misc queries) 0 January 10th 06 03:25 PM
Msgbox Lawson Excel Programming 3 April 6th 04 12:15 AM
MsgBox Randal W. Hozeski Excel Programming 1 January 2nd 04 08:54 PM
Msgbox Bernd[_2_] Excel Programming 0 October 24th 03 10:20 AM


All times are GMT +1. The time now is 03:19 PM.

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

About Us

"It's about Microsoft Excel"