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

Thanks to everyone helping with moving the text box. The
code is
Sub moveit()
MsgBox "Clear Data?", vbQuestion + vbYesNo
ActiveSheet.Shapes("Text Box 1").Select
Selection.Characters.Text = " object to move"
Selection.Top = Sheet1.Range("B2").Top
Selection.Left = Sheet1.Range("B2").Left
Range("A1").Select
End Sub

With regard to the message box, if someone clicks on NO
to clear data, how do I get them to return to Sheet 1
without activating the next lot of code?
Thanks in anticipation.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default MsgBox

Sub moveit()
MsgAns = MsgBox("Clear Data?", vbQuestion + vbYesNo)
If MsgAns = vbYes Then
ActiveSheet.Shapes("Text Box 1").Select
Selection.Characters.Text = " object to move"
Selection.Top = Sheet1.Range("B2").Top
Selection.Left = Sheet1.Range("B2").Left
Range("A1").Select
End If
End Sub

Dan E

"Phil Perry" wrote in message
...
Thanks to everyone helping with moving the text box. The
code is
Sub moveit()
MsgBox "Clear Data?", vbQuestion + vbYesNo
ActiveSheet.Shapes("Text Box 1").Select
Selection.Characters.Text = " object to move"
Selection.Top = Sheet1.Range("B2").Top
Selection.Left = Sheet1.Range("B2").Left
Range("A1").Select
End Sub

With regard to the message box, if someone clicks on NO
to clear data, how do I get them to return to Sheet 1
without activating the next lot of code?
Thanks in anticipation.



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
how can I get a msgbox? AND Excel Discussion (Misc queries) 0 February 12th 09 12:47 PM
msgbox muddan madhu Excel Worksheet Functions 2 April 14th 08 05:06 AM
msgbox in VBA peyman Excel Discussion (Misc queries) 6 October 6th 07 09:35 PM
msgbox peyman Excel Discussion (Misc queries) 5 October 4th 07 09:56 PM
msgbox flow23 Excel Discussion (Misc queries) 0 January 10th 06 03:25 PM


All times are GMT +1. The time now is 01:50 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"