Automatic copy selection and paste in another sheet / cell

livetolearn4life

New Member
Joined
Jul 14, 2020
Messages
7
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
Hello, don't know what is going on here.. I want to copy a value in any cell clicked on in column D on one sheet and automatic paste that value only in cell A1 of the "Dashboard" sheet.. not sure if it is a problem or not, but column A1 in the "Dashboard" sheet is set a drop down list... But the issue is im getting the 1004 run time error at the "Range("A1").Select line below.


Sub Worksheet_SelectionChange(ByVal Target As Range) 'single click version


If Intersect(Target, Range("D:D")) Is Nothing Then
Application.CutCopyMode = False 'clears clipboard and stops cell flashing - like pushing escape key
Exit Sub
Else
ActiveCell.Copy
End If

If Target.Column <> 4 Then Exit Sub

Sheets("DASHBOARD").Select
Range("A1").Select
Selection.PasteSpecial PASTE:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

End Sub
 

Some videos you may like

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,495
Office Version
  1. 365
Platform
  1. Windows
How about
VBA Code:
Sub Worksheet_SelectionChange(ByVal Target As Range) 'single click version


If Intersect(Target, Range("D:D")) Is Nothing Then
Application.CutCopyMode = False 'clears clipboard and stops cell flashing - like pushing escape key
Exit Sub
End If

If Target.Column <> 4 Then Exit Sub

Sheets("results").Range("A1").Value = Target.Value

End Sub
 
Solution

livetolearn4life

New Member
Joined
Jul 14, 2020
Messages
7
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
How about
VBA Code:
Sub Worksheet_SelectionChange(ByVal Target As Range) 'single click version


If Intersect(Target, Range("D:D")) Is Nothing Then
Application.CutCopyMode = False 'clears clipboard and stops cell flashing - like pushing escape key
Exit Sub
End If

If Target.Column <> 4 Then Exit Sub

Sheets("results").Range("A1").Value = Target.Value

End Sub
that did the trick! thanks a million mate!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,495
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,479
Messages
5,625,005
Members
416,065
Latest member
meiravmeron

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
Top