Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Excel and launching userforms

Greetings,

I want to do something that I hope is not too unusual. i want to test a
value in a cell, and if it one thing or another... launch a user form.
Here is the scenario...

test cell a1, if it is greater than 10, then launch userform1, userform1
will ask a question, if yes is selected it will write some text "and" the
contents of cell a1 to cell b1. How do you do this?

Thanks.

-lumpjaw


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel and launching userforms

what is the trigger event.

Do you want to launch the userform each time a cell is selected, each time
there is a calculate, only when A1 is manually edited? When.

See Chip Pearson's page on events
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Lumpjaw" wrote in message
...
Greetings,

I want to do something that I hope is not too unusual. i want to test a
value in a cell, and if it one thing or another... launch a user form.
Here is the scenario...

test cell a1, if it is greater than 10, then launch userform1, userform1
will ask a question, if yes is selected it will write some text "and" the
contents of cell a1 to cell b1. How do you do this?

Thanks.

-lumpjaw



  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Excel and launching userforms

I want the trigger to be after after the data is entered and after
validation if possible.

thx.

-lumpjaw


"Tom Ogilvy" wrote in message
...
what is the trigger event.

Do you want to launch the userform each time a cell is selected, each time
there is a calculate, only when A1 is manually edited? When.

See Chip Pearson's page on events
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Lumpjaw" wrote in message
...
Greetings,

I want to do something that I hope is not too unusual. i want to test a
value in a cell, and if it one thing or another... launch a user form.
Here is the scenario...

test cell a1, if it is greater than 10, then launch userform1, userform1
will ask a question, if yes is selected it will write some text "and" the
contents of cell a1 to cell b1. How do you do this?

Thanks.

-lumpjaw





  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel and launching userforms

Right click on the sheet tab and select view code. Put in code like this in
the resulting module
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" then
if not isempty(target) then
if isnumeric(target) then
if target.Value 10 then
ans = msgbox( "Are you male?", vbYesNo)
if ans = vbYes then
Target.offset(0,1).Value = "Male's age: " & Target.value
end if
end if
end if
end if
end if
End Sub

I used a msgbox. A userform seems overkill here. Substitute a userform if
you wish.

--
Regards,
Tom Ogilvy


"Lumpjaw" wrote in message
...
I want the trigger to be after after the data is entered and after
validation if possible.

thx.

-lumpjaw


"Tom Ogilvy" wrote in message
...
what is the trigger event.

Do you want to launch the userform each time a cell is selected, each
time there is a calculate, only when A1 is manually edited? When.

See Chip Pearson's page on events
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Lumpjaw" wrote in message
...
Greetings,

I want to do something that I hope is not too unusual. i want to test a
value in a cell, and if it one thing or another... launch a user form.
Here is the scenario...

test cell a1, if it is greater than 10, then launch userform1, userform1
will ask a question, if yes is selected it will write some text "and"
the contents of cell a1 to cell b1. How do you do this?

Thanks.

-lumpjaw







  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Excel and launching userforms

Thank You! Works great.

-lumpjaw


"Tom Ogilvy" wrote in message
...
Right click on the sheet tab and select view code. Put in code like this
in the resulting module
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" then
if not isempty(target) then
if isnumeric(target) then
if target.Value 10 then
ans = msgbox( "Are you male?", vbYesNo)
if ans = vbYes then
Target.offset(0,1).Value = "Male's age: " & Target.value
end if
end if
end if
end if
end if
End Sub

I used a msgbox. A userform seems overkill here. Substitute a userform
if you wish.

--
Regards,
Tom Ogilvy


"Lumpjaw" wrote in message
...
I want the trigger to be after after the data is entered and after
validation if possible.

thx.

-lumpjaw


"Tom Ogilvy" wrote in message
...
what is the trigger event.

Do you want to launch the userform each time a cell is selected, each
time there is a calculate, only when A1 is manually edited? When.

See Chip Pearson's page on events
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Lumpjaw" wrote in message
...
Greetings,

I want to do something that I hope is not too unusual. i want to test
a value in a cell, and if it one thing or another... launch a user
form.
Here is the scenario...

test cell a1, if it is greater than 10, then launch userform1,
userform1 will ask a question, if yes is selected it will write some
text "and" the contents of cell a1 to cell b1. How do you do this?

Thanks.

-lumpjaw











  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Excel and launching userforms

Hey Greg,

I was just wondering, how would you apply this code to a range of cells?
Say... A1-A10 and have the result in B1-B10. I tried playing around with it
a bit, but I am just not that good with Excel yet. Thanks.

-Lumpjaw


"Tom Ogilvy" wrote in message
...
Right click on the sheet tab and select view code. Put in code like this
in the resulting module
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" then
if not isempty(target) then
if isnumeric(target) then
if target.Value 10 then
ans = msgbox( "Are you male?", vbYesNo)
if ans = vbYes then
Target.offset(0,1).Value = "Male's age: " & Target.value
end if
end if
end if
end if
end if
End Sub

I used a msgbox. A userform seems overkill here. Substitute a userform
if you wish.

--
Regards,
Tom Ogilvy


"Lumpjaw" wrote in message
...
I want the trigger to be after after the data is entered and after
validation if possible.

thx.

-lumpjaw


"Tom Ogilvy" wrote in message
...
what is the trigger event.

Do you want to launch the userform each time a cell is selected, each
time there is a calculate, only when A1 is manually edited? When.

See Chip Pearson's page on events
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Lumpjaw" wrote in message
...
Greetings,

I want to do something that I hope is not too unusual. i want to test
a value in a cell, and if it one thing or another... launch a user
form.
Here is the scenario...

test cell a1, if it is greater than 10, then launch userform1,
userform1 will ask a question, if yes is selected it will write some
text "and" the contents of cell a1 to cell b1. How do you do this?

Thanks.

-lumpjaw









  #7   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.newusers,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel and launching userforms

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range, ans As Long
Set rng = Intersect(Target, Range("A1:A10"))
On Error GoTo ErrHandler
If Not rng Is Nothing Then
Application.EnableEvents = False
For Each cell In rng
If Not IsEmpty(cell) Then
If IsNumeric(cell) Then
If cell.Value 10 Then
ans = vbNo
ans = MsgBox("Are you male?", vbYesNo)
If ans = vbYes Then
cell.Offset(0, 1).Value = "Male's age: " & cell.Value
End If
End If
End If
End If
Next cell
End If
ErrHandler:
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy


--
Regards,
Tom Ogilvy


"Lumpjaw" wrote in message
...
Hey Greg,

I was just wondering, how would you apply this code to a range of cells?
Say... A1-A10 and have the result in B1-B10. I tried playing around with
it a bit, but I am just not that good with Excel yet. Thanks.

-Lumpjaw


"Tom Ogilvy" wrote in message
...
Right click on the sheet tab and select view code. Put in code like this
in the resulting module
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" then
if not isempty(target) then
if isnumeric(target) then
if target.Value 10 then
ans = msgbox( "Are you male?", vbYesNo)
if ans = vbYes then
Target.offset(0,1).Value = "Male's age: " & Target.value
end if
end if
end if
end if
end if
End Sub

I used a msgbox. A userform seems overkill here. Substitute a userform
if you wish.

--
Regards,
Tom Ogilvy


"Lumpjaw" wrote in message
...
I want the trigger to be after after the data is entered and after
validation if possible.

thx.

-lumpjaw


"Tom Ogilvy" wrote in message
...
what is the trigger event.

Do you want to launch the userform each time a cell is selected, each
time there is a calculate, only when A1 is manually edited? When.

See Chip Pearson's page on events
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Lumpjaw" wrote in message
...
Greetings,

I want to do something that I hope is not too unusual. i want to test
a value in a cell, and if it one thing or another... launch a user
form.
Here is the scenario...

test cell a1, if it is greater than 10, then launch userform1,
userform1 will ask a question, if yes is selected it will write some
text "and" the contents of cell a1 to cell b1. How do you do this?

Thanks.

-lumpjaw











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
Launching Excel From internet Explorer pjnesbitt Excel Discussion (Misc queries) 0 June 27th 06 04:21 PM
Launching Excel by clicking Excel file CDWhite Excel Discussion (Misc queries) 2 January 18th 06 05:42 AM
Launching specific spreadsheet from Desktop in Excel 2003 Tom Excel Discussion (Misc queries) 3 April 30th 05 11:56 PM
launching excel icon results in not opening workbook BobK Excel Discussion (Misc queries) 1 April 5th 05 12:34 AM
Excel 2000 Program not launching Ligaya Excel Discussion (Misc queries) 9 February 24th 05 06:38 PM


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