Range of data to be copied in another sheet

Tushark

New Member
Joined
Mar 2, 2021
Messages
8
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
Hi,

I have this code which helps me in saving data for two cells in different sheet.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = Range("M2").Address Then
Dim intLastRow As Long
intLastRow = Sheet2.Cells(Sheet2.Rows.Count, "A").End(xlUp).Row
Sheet2.Cells(intLastRow + 1, "B") = Target.Value

ElseIf Target.Address = Range("M3").Address Then
Dim intLastRow2 As Long
intLastRow2 = Sheet2.Cells(Sheet2.Rows.Count, "B").End(xlUp).Row
Sheet2.Cells(intLastRow2 + 1, "B") = Target.Value
End If
End Sub

With this code working i want to save the data for the range P2:P7 and AC2:AC7 in different sheet. They should be saved in different columns (Like P2 data goes to C, P3 data goes to D so on) so that i can do comparison later.

Thanks in Advance.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,704
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Yes you have - see the link in my post.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,628
Office Version
  1. 365
Platform
  1. Windows
Judging by your image C2 & C3 are formulae & therefore a change event wont work. Also you have merged cells.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,724
Messages
5,637,997
Members
416,998
Latest member
bbowne

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