Show Activecell Date in MsgBox

A

Aussie Bob C

Can the date in the ActiveCell be shown in a MsgBox, allowing the user to
check whether to continue or Cancel the macro running. All data on and below
the ActiveCell is cut and pasted into second sheet.

--
Thank you

Aussie Bob C
Little cost to carry knowledge with you.
Win XP P3 Office 2007 on Mini Mac using VMware.
 
D

Dave Peterson

dim resp as long

resp = msgbox(Prompt:="Value is: " & format(activecell.value, "mmm dd, yyyy") _
& vblf & "Continue?", buttons:=vbyesno)

if resp = vbno then
exit sub '???
end if

'do the rest.

=====
This doesn't do any checking that the activecell actually contains a date.
 
M

Mike H

Hi,

try this

' Lots of code
ttl = "Todays Date"
response = MsgBox(Format(ActiveCell.Value, "DD/mm/yyyy") _
& " Continue Yes/No", vbYesNo, ttl)
If response = vbNo Then Exit Sub

'More code
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
C

Chip Pearson

Try something like

MsgBox "The date in the active cell is " & _
Format(ActiveCell.Value, "dd-mmm-yyyy"), vbOKOnly

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top