#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Input box

Hi there,

I have column P titled "Are controls for fraud risks working?" and I have
one next to it "give a description" I only need some narrative in there if
they select no on my dropdown for are the controls working column - is there
a really easy way of doing this with an input box?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Input box

Hi
I've read this a couple of times and still can't make sense of it. A
bit less haste in typing maybe?
regards
Paul


On Mar 14, 1:02 pm, Pasty wrote:
Hi there,

I have column P titled "Are controls for fraud risks working?" and I have
one next to it "give a description" I only need some narrative in there if
they select no on my dropdown for are the controls working column - is there
a really easy way of doing this with an input box?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Input box

Basically column p is a drop down box (yes/no) if they select yes then no
further action is required, if they select no they have to fill in a reason
in the cell next to it. Is this clearer?

" wrote:

Hi
I've read this a couple of times and still can't make sense of it. A
bit less haste in typing maybe?
regards
Paul


On Mar 14, 1:02 pm, Pasty wrote:
Hi there,

I have column P titled "Are controls for fraud risks working?" and I have
one next to it "give a description" I only need some narrative in there if
they select no on my dropdown for are the controls working column - is there
a really easy way of doing this with an input box?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Input box

Hi
Certainly is:

Put this in the code module behind your sheet that the dropdown is on
(in Editor, double click the sheet name)

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns("P")) Is Nothing Then
If Target.Value = "no" Then
Response = InputBox("Any Reason?")
Target.Offset(0, 1).Value = Response
End If
End If
End Sub

regards
Paul

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Input box

This looks along the right lines but when I use it no input box pops up.

" wrote:

Hi
Certainly is:

Put this in the code module behind your sheet that the dropdown is on
(in Editor, double click the sheet name)

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns("P")) Is Nothing Then
If Target.Value = "no" Then
Response = InputBox("Any Reason?")
Target.Offset(0, 1).Value = Response
End If
End If
End Sub

regards
Paul




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Input box

will Column P contain Lower case "n" and Lower case "o". If not, there's
your huckleberry. To account for that

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.count 1 then exit sub
If Not Intersect(Target, Columns("P")) Is Nothing Then
If lcase(Target.Value) = "no" Then
Response = InputBox("Any Reason?")
Target.Offset(0, 1).Value = Response
End If
End If
End Sub

If the above doesn't correct the problem, then have you put this in the
sheet module of the sheet with the data? Are events enabled?

--
Regards,
Tom Ogilvy


"Pasty" wrote:

This looks along the right lines but when I use it no input box pops up.

" wrote:

Hi
Certainly is:

Put this in the code module behind your sheet that the dropdown is on
(in Editor, double click the sheet name)

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns("P")) Is Nothing Then
If Target.Value = "no" Then
Response = InputBox("Any Reason?")
Target.Offset(0, 1).Value = Response
End If
End If
End Sub

regards
Paul


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Input box

I changed the N and o to reflect whats in my drop down - whats this enable
events bit you speak of?

You'll have to forgive my ignorance its just I've decided to teach myself VBA!

"Tom Ogilvy" wrote:

will Column P contain Lower case "n" and Lower case "o". If not, there's
your huckleberry. To account for that

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.count 1 then exit sub
If Not Intersect(Target, Columns("P")) Is Nothing Then
If lcase(Target.Value) = "no" Then
Response = InputBox("Any Reason?")
Target.Offset(0, 1).Value = Response
End If
End If
End Sub

If the above doesn't correct the problem, then have you put this in the
sheet module of the sheet with the data? Are events enabled?

--
Regards,
Tom Ogilvy


"Pasty" wrote:

This looks along the right lines but when I use it no input box pops up.

" wrote:

Hi
Certainly is:

Put this in the code module behind your sheet that the dropdown is on
(in Editor, double click the sheet name)

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns("P")) Is Nothing Then
If Target.Value = "no" Then
Response = InputBox("Any Reason?")
Target.Offset(0, 1).Value = Response
End If
End If
End Sub

regards
Paul


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Input box

Hi
This code needs to be in the correct place or it won't work. Open the
VB editor. In the project window (left hand side) you will see your
excel filename and under it various sheet names. Double click the
sheetname where you have your dropdown (I was assuming this was a
validation list to give you consistency of spelling yes/no). Now paste
Tom's code into the blank module.
I'm assuming, of course, that your dropdown really is in column P??
Also, I'm assuming you changed the value to no from yes. This will
fire the change event.
The events enabled bit just allows your sheet to respond to the change
in the cell value. You can switch this off using code but you probably
havn't done this so nothing to worry about there.
regards
Paul

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Input box

Its okay I figured it out I just had to remove the LCase bit. Thanks for all
your help guys.

" wrote:

Hi
This code needs to be in the correct place or it won't work. Open the
VB editor. In the project window (left hand side) you will see your
excel filename and under it various sheet names. Double click the
sheetname where you have your dropdown (I was assuming this was a
validation list to give you consistency of spelling yes/no). Now paste
Tom's code into the blank module.
I'm assuming, of course, that your dropdown really is in column P??
Also, I'm assuming you changed the value to no from yes. This will
fire the change event.
The events enabled bit just allows your sheet to respond to the change
in the cell value. You can switch this off using code but you probably
havn't done this so nothing to worry about there.
regards
Paul


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Input box

You didn't have to remove it (lcase) if you didn't change the no to No. You
need to do one or the other - not both.

Apparently you have a bad teacher <g

--
Regards,
Tom Ogilvy


"Pasty" wrote:

Its okay I figured it out I just had to remove the LCase bit. Thanks for all
your help guys.

" wrote:

Hi
This code needs to be in the correct place or it won't work. Open the
VB editor. In the project window (left hand side) you will see your
excel filename and under it various sheet names. Double click the
sheetname where you have your dropdown (I was assuming this was a
validation list to give you consistency of spelling yes/no). Now paste
Tom's code into the blank module.
I'm assuming, of course, that your dropdown really is in column P??
Also, I'm assuming you changed the value to no from yes. This will
fire the change event.
The events enabled bit just allows your sheet to respond to the change
in the cell value. You can switch this off using code but you probably
havn't done this so nothing to worry about there.
regards
Paul


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 to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 02:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"