How Good Are You?

jamesmev

Board Regular
Joined
Apr 9, 2015
Messages
233
Office Version
  1. 365
Platform
  1. Windows
Solve this riddle if you would...

Within A Table:

Product Suggested Price Number Per Litter
Dog 9.99 9
Cat 5.99 5
Bat 2.00 3



User clicks: "DOG" within the table

That then places

Litter Number in Cell B2 (9)
and Suggested Price in Cell B3 (9.99)


Any Advice?

Thanks in advance.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
The action takes place when the cell is clicked. That is the difficulty.
I have"

Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("C:C")) Is Nothing Then
Cancel = True
Target.Copy Destination:=Sheets("Sheet1").Range("C9")
End If
End Sub"

But it only selects one selection not all the selections in that row and to the correct ranges.
 
Upvote 0
What is the exact range that this table of yours is in?
 
Upvote 0
Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("C:C")) Is Nothing Then
Cancel = True
Target.Copy Destination:=Sheets("Sheet1").Range("C9")
End If
End Sub"

But it only selects one selection not all the selections in that row and to the correct ranges.
Actually, your code does not "select" any cells, it assigns the value from the cell double-clicked on to cell C9.

In addition to the question Joe4 asked in Message #4 , what is not clear to me is if there are more than one Dog in the list, how should all the litter numbers be returned to you... do you want each litter number in a separate cell (if so, which cells)?... or do you want them all placed in cell C9 perhaps with a comma space between them?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,577
Messages
6,173,163
Members
452,503
Latest member
AM74

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top