MACRO ISSUE?

TMM

New Member
Joined
Jan 8, 2021
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
I need help figuring out how to double click a cell and have the value of another cell populate in the double-clicked cell. I have a macro that will do that in one cell but I can't figure out how to get the other cells to do the same. If cell G6 is double-clicked the text in C6 will copy to G6. Each cell will need to do this. If there is a better way please let me know! Thank you so much for your time!

excel.jpg

The macro I have is:
Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Range("E3").Value = Range("C3").Value
End Sub
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
try this:
VBA Code:
[/I]
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
rowno = Target.Row
Target.Value = Range("C" & rowno).Value
End Sub

[I]
 
Upvote 0
Solution
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) rowno = Target.Row Target.Value = Range("C" & rowno).Value End Sub
Thank you So Much!!! It works wonderfully!!!!
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

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