#1   Report Post  
Jasper
 
Posts: n/a
Default MsgBox OKCancel

I tried to make a message box which pops u when I hit a button. The question
should be "are you sure?" when OK then it continues to the "Sub
Get_Inkoopdelen_Data()" when Cancel it has to return to the sheet "Index".

I tried:

Sub Bevesiging_ARF_Vullen()

Dim i As Long
Dim rng As Range
Dim intButton As Integer
intButton = MsgBox("Is het bron bestand geopend?" &
vbNewLine
"Klick "OK" om te vervolgen. Klick "Cancel" om terug te keren.",
vbOKCancel + vbInformation, "Kosten Database Vullen")
If intButton = vbCancel Then Exit Sub
If intButton = vbOK Then Sheets("Index").Select
End If
Next i
End Sub


MY QUESTION:

"What code should I use to "get a message box which pops u when I hit the
"Fill Database" button on the INDEX sheet. When the question should be "are
you sure?" when OK then it continues to the "Sub Get_Inkoopdelen_Data()" when
Cancel it has to return to the sheet "Index""?

Thanks in advance!

Jasper
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Sub Bevesiging_ARF_Vullen()

Dim i As Long
Dim rng As Range
Dim intButton As Integer
intButton = MsgBox("Are you sure?.", _
vbOKCancel + vbInformation, "Kosten Database Vullen")
If intButton = vbOK Then
Get_Inkoopdelen_Data()
ElseIf intButton = vbCancel Then
Sheets("Index").Select
End If
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jasper" wrote in message
...
I tried to make a message box which pops u when I hit a button. The

question
should be "are you sure?" when OK then it continues to the "Sub
Get_Inkoopdelen_Data()" when Cancel it has to return to the sheet "Index".

I tried:

Sub Bevesiging_ARF_Vullen()

Dim i As Long
Dim rng As Range
Dim intButton As Integer
intButton = MsgBox("Is het bron bestand geopend?" &
vbNewLine
"Klick "OK" om te vervolgen. Klick "Cancel" om terug te keren.",
vbOKCancel + vbInformation, "Kosten Database Vullen")
If intButton = vbCancel Then Exit Sub
If intButton = vbOK Then Sheets("Index").Select
End If
Next i
End Sub


MY QUESTION:

"What code should I use to "get a message box which pops u when I hit the
"Fill Database" button on the INDEX sheet. When the question should be

"are
you sure?" when OK then it continues to the "Sub Get_Inkoopdelen_Data()"

when
Cancel it has to return to the sheet "Index""?

Thanks in advance!

Jasper



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
Help with MsgBox... tjb Excel Worksheet Functions 3 December 29th 04 03:43 PM
Select non-consecutive rows dee Excel Discussion (Misc queries) 14 December 4th 04 08:45 PM
Problem with array and msgbox aking1987 Excel Worksheet Functions 0 November 1st 04 08:57 AM
Problem with array and msgbox aking1987 Excel Worksheet Functions 1 October 29th 04 01:57 PM
Problem with array and msgbox aking1987 Excel Worksheet Functions 2 October 28th 04 06:20 PM


All times are GMT +1. The time now is 06:39 AM.

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"