Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UseFunction question

watch the typo

Dim ans was Long

should be

Dim ans as Long

--
Regards,
Tom Ogilvy


"bumper338" wrote in message
...
Thanks Tom,

That is what I was looking for.

Tj

Also, Thanks Alok and John.

"Tom Ogilvy" wrote:

Sub UseFunction()

Dim myRange As Range
Dim answer
Dim ans was Long
Set myRange = Worksheets("Sheet1").Range("A1:C10")
answer = Application.WorksheetFunction.Sum(myRange)

If answer 3 Then
ans = MsgBox("You have " & _
answer & " hours", vbYesNo + _
vbQuestion, "Test")
if ans = vbYes then
Worksheets("Sheet1").Range("C12").Value = _
answer
end if
End If
End Sub

--
Regards,
Tom Ogilvy


"bumper338" wrote:

I am using the following:

Sub UseFunction()

Dim myRange As Range
Set myRange = Worksheets("Sheet1").Range("A1:C10")
answer = Application.WorksheetFunction.Sum(myRange)

If answer 3 Then
answer = MsgBox("You have " & [answer] & " hours", vbYesNo +
vbQuestion, "Test")
End If
End Sub


What I would like to do, is when the user clicks on the Yes button, it
puts
the answer in an open cell.

How would I do that?

Thanks in advance



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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM


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