Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Data entry for fixed cell ranges

Hi
I have an Excel worksheet with fixed data in cell ranges. Say in
C2:C9 and B2:B8 the data is fixed. If I click on any of the cells in
this range C2:C9 and I would like “Penicillin = Sensitive” entered
into cell A11 and If I click on any of the cells in this range C2:C9
and I would like “Augmentin = Sensitive” entered into cell B12. There
are a whole lot of other ranges to work with too but if someone could
steer me in a direction I would be able to work the rest out myself

Any help is much appreciated.

Thanks
Eddie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Data entry for fixed cell ranges

Hi

This is event code and has to be pasted into the code sheet for you
worksheet.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B2:B8")) Is Nothing Then
Range("A11") = "Penicilin = Sensitive"
ElseIf Not Intersect(Target, Range("C2:C8")) Is Nothing Then
Range("B12") = "Augmentine = Sensitive"
End If
End Sub

Regards,
Per

"webels" skrev i meddelelsen
...
Hi
I have an Excel worksheet with fixed data in cell ranges. Say in
C2:C9 and B2:B8 the data is fixed. If I click on any of the cells in
this range C2:C9 and I would like “Penicillin = Sensitive” entered
into cell A11 and If I click on any of the cells in this range C2:C9
and I would like “Augmentin = Sensitive” entered into cell B12. There
are a whole lot of other ranges to work with too but if someone could
steer me in a direction I would be able to work the rest out myself

Any help is much appreciated.

Thanks
Eddie

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data entry for fixed cell ranges


You could use in the Data menu Validation - List. You can put in the
List a range of cells or a list of differrent strings. This will create
a drop down list for your selection.

Remember that you want to be able to remove an item if put data into
the wrong cell.


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=144058

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Data entry for fixed cell ranges

On Oct 14, 12:30*pm, "Per Jessen" wrote:
Hi

This is event code and has to be pasted into the code sheet for you
worksheet.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B2:B8")) Is Nothing Then
* * Range("A11") = "Penicilin = Sensitive"
ElseIf Not Intersect(Target, Range("C2:C8")) Is Nothing Then
* * Range("B12") = "Augmentine = Sensitive"
End If
End Sub

Regards,
Per

"webels" skrev i ...
Hi
I have an Excel worksheet with fixed data in cell ranges. *Say in
C2:C9 and B2:B8 the data is fixed. If I click on any of the cells in
this range C2:C9 and I would like “Penicillin = Sensitive” entered
into cell A11 and If I click on any of the cells in this range C2:C9
and I would like “Augmentin = Sensitive” entered into cell B12. There
are a whole lot of other ranges to work with too but if someone could
steer me in a direction I would be able to work the rest out myself

Any help is much appreciated.

Thanks
Eddie


Thanks Per great code works perfectly, thanks Joel also for your
suggestion.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Data entry for fixed cell ranges

On Oct 14, 2:36*pm, webels wrote:
On Oct 14, 12:30*pm, "Per Jessen" wrote:





Hi


This is event code and has to be pasted into the code sheet for you
worksheet.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B2:B8")) Is Nothing Then
* * Range("A11") = "Penicilin = Sensitive"
ElseIf Not Intersect(Target, Range("C2:C8")) Is Nothing Then
* * Range("B12") = "Augmentine = Sensitive"
End If
End Sub


Regards,
Per


"webels" skrev i ...
Hi
I have an Excel worksheet with fixed data in cell ranges. *Say in
C2:C9 and B2:B8 the data is fixed. If I click on any of the cells in
this range C2:C9 and I would like “Penicillin = Sensitive” entered
into cell A11 and If I click on any of the cells in this range C2:C9
and I would like “Augmentin = Sensitive” entered into cell B12. There
are a whole lot of other ranges to work with too but if someone could
steer me in a direction I would be able to work the rest out myself


Any help is much appreciated.


Thanks
Eddie


Thanks Per great code works perfectly, thanks Joel also for your
suggestion.- Hide quoted text -

- Show quoted text -


Hi again
What I set up as described above by Per is working perfectly, I was
just wondering if it would be possible to add the Value in the cell
clicked to the current out to look something like this "Penicillin =
Sensitive (0.0064)". 0.0064 being the value in the cell clicked.

Thanks again
Eddie


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Data entry for fixed cell ranges

Hi Eddie

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B2:B8")) Is Nothing Then
Range("A11") = "Penicilin = Sensitive (" & Target.Value & ")"
ElseIf Not Intersect(Target, Range("C2:C8")) Is Nothing Then
Range("B12") = "Augmentine = Sensitive (" & Target.Value & ")"
End If
End Sub

Regards,
Per


Hi again
What I set up as described above by Per is working perfectly, I was
just wondering if it would be possible to add the Value in the cell
clicked to the current out to look something like this "Penicillin =
Sensitive (0.0064)". 0.0064 being the value in the cell clicked.

Thanks again
Eddie

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Data entry for fixed cell ranges

On Oct 17, 9:07*pm, "Per Jessen" wrote:
Hi Eddie

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B2:B8")) Is Nothing Then
* * Range("A11") = "Penicilin = Sensitive (" & Target.Value & ")"
ElseIf Not Intersect(Target, Range("C2:C8")) Is Nothing Then
* * Range("B12") = "Augmentine = Sensitive (" & Target.Value & ")"
End If
End Sub

Regards,
Per



Hi again
What I set up as described above by Per is working perfectly, I was
just wondering if it would be possible to add the Value in the cell
clicked to the current out to look something like this "Penicillin =
Sensitive (0.0064)". 0.0064 being the value in the cell clicked.


Thanks again
Eddie- Hide quoted text -


- Show quoted text -


Thats exactly what I need Per - thank you for your very helpful and
prompt assistance
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
Can I lock a cell after data entry so entry can not be changed Verlinde Excel Discussion (Misc queries) 3 April 22nd 10 07:59 PM
How do I force entry in multiple cell ranges in one worksheet CindyB Excel Worksheet Functions 0 July 10th 08 06:08 PM
Control Data Entry - push entry to next cell Ofelia Excel Discussion (Misc queries) 0 July 7th 08 04:19 PM
Cell Entry That Locks Selected Cells From Any Data Entry. ron Excel Worksheet Functions 5 February 16th 07 09:52 PM
Need formula for a fixed cell minus last entry on ongoing log Mari C Excel Worksheet Functions 5 July 16th 05 09:52 PM


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