LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Automatically fill a cell with predetermined

You could do something like:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 2 Then Target.Value = "No"
End Sub

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Column = 2 Then
Target.Value = "Yes"
Cancel = True
End If
End Sub


But I prefer the RightClick method:

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Column = 2 Then
Select Case Target.Value
Case "No": Target.Value = "Yes"
Case Else: Target.Value = "No"
End Select
Cancel = True
End If
End Sub

Rob


"Mike Taylor" wrote in message
om...
Don,

Am interested in this thread. What code would result in having "this
in the same column by using a single click for no and a double click
for yes"? I can't seem to figure it out? TIA

Mike

"Don Guillett" wrote in message

...
BTW, you could even have this in the same column by using a single click

for
no and a double click for yes.

--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
right click sheet tabview codecopy/paste thissave workbook.
Works for row 4 on down

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row 3 Then
If Target.Column = 2 Then Target = "Yes"
If Target.Column = 3 Then Target = "No"
End If
End Sub

--
Don Guillett
SalesAid Software

"John" wrote in message
...
Using Excel2000
I am setting up a survey with questions in column A
and responses in columns B & C.
Column B is for Yes, & column C is for NO

Is there any way to have the responses automatically put in the

cells
when the user clicks on the appropriate cell.

i.e.
COLUMN A COLUMN B COLUMN C
Question1 Yes
Question2 No
Question3 Yes
Question4 Yes

I would like the responses automatically put in the cell just
by clicking in the cell.
Is this possible.

P.S. The questionaire is more complex that just yes or no,
but this gives the gist of what I am tryin to achieve.








 
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
Can Excel fill in numbers to equal a predetermined total? MomHudd New Users to Excel 1 February 13th 10 02:04 PM
Getting a prompt to automatically fill a cell Zahra Excel Discussion (Misc queries) 0 April 30th 08 09:13 PM
Automatically fill cell value ingalla Excel Worksheet Functions 1 March 28th 07 08:58 PM
How do I automatically fill a cell based on another cell in Excel SouthCarolina Excel Discussion (Misc queries) 3 January 13th 06 12:52 AM
automatically fill up a cell? polletje[_4_] Excel Programming 8 January 6th 04 11:15 PM


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