Fill cell A with data from cell B by clicking cell C

rfinnegan

Board Regular
Joined
Mar 15, 2005
Messages
173
Office Version
  1. 365
Platform
  1. Windows
Hi All:

I'm stumped on this. Please help -

I want to click on cell H13 and have the info from W13 appear in O7. Or click I13 and have the info from X13 appear in O7, etc... (O7 will simply be set with a barcode font).

Thanks in advance.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Perhaps this code might help. Paste it in to the code module for the worksheet you want it to run on, and change the 'Clickable Range' as you see fit.
Code:
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    Dim clickableRange      As Range
    Set clickableRange = Range("H:I")       'edit this as you see fit
    
    If Not Intersect(Target, clickableRange) Is Nothing And Target.Cells.Count = 1 Then
        Target.Offset(0, 15).Value = Range("O7").Value
    End If
    
End Sub

Hope that helps.

/AJ
 
Upvote 0
Thanks Adam. It didn't quite work, but I managed to steal some of it and add it to a different piece of code I had.

Here was the final result -

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address <> "" Then Range("o7").Value = Target.Offset(0, 15)
End Sub

thanks again
 
Upvote 0
Oh yeah. Might have helped if I'd read the question thoroughly. Glad it helped though, thanks for the feedback :)

/AJ
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,200
Members
449,072
Latest member
DW Draft

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