VBA script copy cell based on value in column

meanse

New Member
Joined
Jun 15, 2012
Messages
2
Hi,

I have an Excel spreadsheet that has 3 columns and thousands of rows.

The value in the third column indicates which row to copy. I am looking to copy the value from column A to column D if C has a value.
Then based off the number in C copy the value from A to E


EXAMPLE:

-- removed inline image ---


I know it is a simple one, but the options I have tried are simply not giving me the results. Any help will be appreciated.

Thanks,
Eric
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
I apologize the image I used was not visible but my 10 min edit time exceed so I am including more details on the issue in this post.

Hi,

I have an Excel spreadsheet that has 3 columns and thousands of rows.

The value in the third column indicates which row to copy. I am looking to copy the value from column A to column D if C has a value.
Then based off the number in C copy the value from A to E

If row 1 column C1 has a any value (greater 1 or greater) then D1 has the value of A1
Using the value in C1 it will determine which row to copy the value of column A from in the example row 1 below has a value of 1.
This would populate A1 into E1

Row 7 below C7 has a value of 4
This would cause D7 to be populated with the value from A7 (same as above)then using the value 4 go down to row 10
copy the value from A10 to E7

EXAMPLE:

A B C D E
1OPM0000001
Y
1 OPM0000001
OPM0000001
2OPM0000002
Y
1 OPM0000002
OPM0000002
3OPM0000003
Y
1 OPM0000003
OPM0000003
4OPM0000004
Y
1 OPM0000004
OPM0000004
5 OPM0000005
Y
1 OPM0000005
OPM0000005
6 OPM0000006
Y
1 OPM0000006
OPM0000006
7 OPM0000007
Y
4
OPM0000007
OPM0000010
8 OPM0000008
9 OPM0000009
10OPM0000010
11OPM0000011
Y2 OPM0000011
OPM0000012
12OPM0000012
13OPM0000013
Y2 OPM0000013
OPM0000014
14OPM0000014
15OPM0000015
Y4 OPM0000015
OPM0000018
16OPM0000016
17OPM0000017
18OPM0000018
19OPM0000019
Y2 OPM0000019
OPM0000020

<colgroup><col style="mso-width-source:userset;mso-width-alt:3145;width:65pt" width="86"> <col style="mso-width-source:userset;mso-width-alt:585;width:12pt" width="16"> <col style="mso-width-source:userset;mso-width-alt:1024;width:21pt" width="28"> <col style="mso-width-source:userset;mso-width-alt:3145; width:65pt" span="2" width="86"> <col style="width:48pt" span="2" width="64"> </colgroup><tbody>
</tbody>


I know it is a simple one, but the options I have tried are simply not giving me the results. Any help will be appreciated.

Thanks,
Eric
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,454
Members
449,083
Latest member
Ava19

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