Copy and Paste certain values to a certain cell

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
350
Office Version
  1. 365
Platform
  1. Windows
Experts,

I have a table with columns from week 1 to week 52. I would like to ask for assistance if it is possible that every time I enter certain text into a cell, it will copy and paste the same text into another cell. Really appreciate your help..


See below;

Let say, In Name1 I insert a check (1) on W1, it should copy and paste automatic quarterly, (W12,W24, W36, and W48)
In Name2 I insert a check (1) on W4 it should copy and paste to W15,W27,W39 and W51
The first entry is always in random, it could be in any week.


Note:1 = check symbol on my original file
NameW1W2W3W4W5W6W7W8W9W10W11W12W13W14W15W16W17W18W19W20W21W22W23W24W25W26W27W28W29W30W31W32W33W34W35W36W37W38W39W40W41W42W43W44W45W46W47W48W49W50W51W52
Name1​
11111
Name2​
11111
Name3​
Name4​
Name5​
Name6​
Name7​
Name8​
Name9​
Name10​
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try this:
Will work with column 2 to 53 it looks like you have names in column 1
Modify if needed
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  7/17/2022  2:56:28 PM  EDT
Application.EnableEvents = False
If Target.Column > 1 And Target.Column < 54 And Target.Row > 1 Then
Target.Offset(, 11).Value = Target.Value
Target.Offset(, 23).Value = Target.Value
Target.Offset(, 35).Value = Target.Value
Target.Offset(, 47).Value = Target.Value
Application.EnableEvents = True

MsgBox "Done"
End If
End Sub
 
Upvote 0
Try this:
Will work with column 2 to 53 it looks like you have names in column 1
Modify if needed
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  7/17/2022  2:56:28 PM  EDT
Application.EnableEvents = False
If Target.Column > 1 And Target.Column < 54 And Target.Row > 1 Then
Target.Offset(, 11).Value = Target.Value
Target.Offset(, 23).Value = Target.Value
Target.Offset(, 35).Value = Target.Value
Target.Offset(, 47).Value = Target.Value
Application.EnableEvents = True

MsgBox "Done"
End If
End Sub
Thanks a lot it works . However when I insert another value (other than 1) it also replicates.. Would it be possible that if the other value was used, it would not replicate?
1658128713038.png
 
Upvote 0
Try this:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  7/18/2022  11:09:33 AM  EDT
Application.EnableEvents = False
If Target.Column > 1 And Target.Column < 54 And Target.Row > 1 Then
If Target.Value = 1 Then
    Target.Offset(, 11).Value = Target.Value
    Target.Offset(, 23).Value = Target.Value
    Target.Offset(, 35).Value = Target.Value
    Target.Offset(, 47).Value = Target.Value
End If

Application.EnableEvents = True

End If
End Sub
 
Upvote 0
Solution
Try this:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  7/18/2022  11:09:33 AM  EDT
Application.EnableEvents = False
If Target.Column > 1 And Target.Column < 54 And Target.Row > 1 Then
If Target.Value = 1 Then
    Target.Offset(, 11).Value = Target.Value
    Target.Offset(, 23).Value = Target.Value
    Target.Offset(, 35).Value = Target.Value
    Target.Offset(, 47).Value = Target.Value
End If

Application.EnableEvents = True

End If
End Sub
cool.. works like a charm.. thank you very much..
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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