dominikapabis
New Member
- Joined
- Feb 9, 2016
- Messages
- 4
Hello,
I am looking for help on writing a VBA that will replace information in one sheet using a legend that is in another sheet.
I need two things to happen.
1. replace cells in column C in Sheet1 with data from column C in Sheet2 if column C in Sheet1 = column A in Sheet2.
2. also insert the adjacent cell (Item Number) that corresponds with the new description.
Here is a simple sample of the spreadsheet.
Sheet 1 BEFORE Code:
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]EQUIPMENT TYPE[/TD]
[TD="align: center"]ITEM NUMBER[/TD]
[TD="align: center"]DESCRIPTION[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]Actives [/TD]
[TD="align: center"][/TD]
[TD="align: center"]NC400[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]Full Spectrum EQ- Bank 1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]T2&4 CS12
[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]T2&4 CS09[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]Full Spectrum EQ - Bank 2[/TD]
[TD="align: center"][/TD]
[TD="align: center"]T8 CS09
[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]T8 CS06[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2 (KEY)
[TABLE="width: 500"]
<tbody>[TR]
[TD]1
[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: center"]Original Description[/TD]
[TD="align: center"]Item Number[/TD]
[TD="align: center"]New Description[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]
[TD]5543
[/TD]
[TD]Full Features 2x2[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]
[TD]5568[/TD]
[TD]Cable Simulator 12db
[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]
[TD]9956[/TD]
[TD]Cable Simulator 9db
[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]
[TD]5547[/TD]
[TD]Return Path 9db[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]
[TD]6689[/TD]
[TD]Return Path 6db[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 1 AFTER CODE:
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]EQUIPMENT TYPE[/TD]
[TD="align: center"]ITEM NUMBER[/TD]
[TD="align: center"]DESCRIPTION[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]Actives [/TD]
[TD="align: center"]5543[/TD]
[TD="align: center"]Full Features 2x2[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]Full Spectrum EQ- Bank 1[/TD]
[TD="align: center"]5568[/TD]
[TD="align: center"]Cable Simulator 12db[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"][/TD]
[TD="align: center"]9956
[/TD]
[TD="align: center"]Cable Simulator 9db[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]Full Spectrum EQ - Bank 2[/TD]
[TD="align: center"]5547[/TD]
[TD="align: center"]Return Path 9db[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"][/TD]
[TD="align: center"]6689[/TD]
[TD="align: center"]Return Path 6db[/TD]
[/TR]
</tbody>[/TABLE]
I know that I will have to use a series of loops, I would appreciate any help.
Thanks!`
I am looking for help on writing a VBA that will replace information in one sheet using a legend that is in another sheet.
I need two things to happen.
1. replace cells in column C in Sheet1 with data from column C in Sheet2 if column C in Sheet1 = column A in Sheet2.
2. also insert the adjacent cell (Item Number) that corresponds with the new description.
Here is a simple sample of the spreadsheet.
Sheet 1 BEFORE Code:
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]EQUIPMENT TYPE[/TD]
[TD="align: center"]ITEM NUMBER[/TD]
[TD="align: center"]DESCRIPTION[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]Actives [/TD]
[TD="align: center"][/TD]
[TD="align: center"]NC400[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]Full Spectrum EQ- Bank 1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]T2&4 CS12
[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]T2&4 CS09[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]Full Spectrum EQ - Bank 2[/TD]
[TD="align: center"][/TD]
[TD="align: center"]T8 CS09
[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]T8 CS06[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2 (KEY)
[TABLE="width: 500"]
<tbody>[TR]
[TD]1
[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: center"]Original Description[/TD]
[TD="align: center"]Item Number[/TD]
[TD="align: center"]New Description[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]
NC400
[/TD][TD]5543
[/TD]
[TD]Full Features 2x2[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]
T2&4 CS12
[/TD][TD]5568[/TD]
[TD]Cable Simulator 12db
[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]
T2&4 CS09
[/TD][TD]9956[/TD]
[TD]Cable Simulator 9db
[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]
T8 CS09
[/TD][TD]5547[/TD]
[TD]Return Path 9db[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]
T8 CS06
[/TD][TD]6689[/TD]
[TD]Return Path 6db[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 1 AFTER CODE:
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]EQUIPMENT TYPE[/TD]
[TD="align: center"]ITEM NUMBER[/TD]
[TD="align: center"]DESCRIPTION[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]Actives [/TD]
[TD="align: center"]5543[/TD]
[TD="align: center"]Full Features 2x2[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]Full Spectrum EQ- Bank 1[/TD]
[TD="align: center"]5568[/TD]
[TD="align: center"]Cable Simulator 12db[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"][/TD]
[TD="align: center"]9956
[/TD]
[TD="align: center"]Cable Simulator 9db[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]Full Spectrum EQ - Bank 2[/TD]
[TD="align: center"]5547[/TD]
[TD="align: center"]Return Path 9db[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"][/TD]
[TD="align: center"]6689[/TD]
[TD="align: center"]Return Path 6db[/TD]
[/TR]
</tbody>[/TABLE]
I know that I will have to use a series of loops, I would appreciate any help.
Thanks!`