Worksheet change event required for linking sheets

Jyotirmaya

Board Regular
Joined
Dec 2, 2015
Messages
205
Office Version
  1. 2019
Platform
  1. Windows
Worksheet change event code required for linking between 2 sheets one is Raw Data other one is SH


I want that if there will be any value in AH column of Raw data sheet then B Column value of Raw data sheet will be linked to C column of SH sheet staring from Row 4 onward in SH sheet.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
use this code

for i=4 to 100
if Sheets("Raw Data").Range("AH" & i)<>"" then
Sheets("SH").Range("C" & i)=Sheets("Raw Data").Range("B" & i)
end if
next
 
Upvote 0
use this code


for i=4 to 100
if Sheets("Raw Data").Range("AH" & i)<>"" then
Sheets("SH").Range("C" & i)=Sheets("Raw Data").Range("B" & i)
end if
next


can you please complete the VBA code from the begining ? I am not aware of VB much.
 
Upvote 0
Sub test
for i=4 to 100
if Sheets("Raw Data").Range("AH" & i)<>"" then
Sheets("SH").Range("C" & i)=Sheets("Raw Data").Range("B" & i)
end if
next
End sub
 
Upvote 0
Sub test
for i=4 to 100
if Sheets("Raw Data").Range("AH" & i)<>"" then
Sheets("SH").Range("C" & i)=Sheets("Raw Data").Range("B" & i)
end if
next
End sub

It works thanks..


Little more help I want. I want some addition of code in the existing code.


for example the AH4 have some value then as per the code Raw data B4 = SH C4


For example, again in AH8 there is value so in that case I want sum of Raw data M5 M6 M7 M8 in the next row of SH in D column.
 
Upvote 0
what is sequence for filling the value in column D, I mean what should be the value in SH- D4 if there is data in Raw Data- AH4 or the logic for this neds to start from row 8 only?
 
Upvote 0
Capture.JPG


As you can see the pic where there is single entry I can get copied the values from Raw Data sheet to SH sheet with your code but where there are multiple entries I need the sum of Total column of M S & Y in the SH sheet.

I have headers in SH sheet so the values can be started copying from Row4 of SH sheet onwards

SH sheet demo.. I want like this

sh.JPG
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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