Help with loop code

remejiah

New Member
Joined
Jul 13, 2016
Messages
17
I have a column of account numbers that I need to individually copy and paste into another worksheet that will yield a result and then I want to paste that result next to the account number and perform that function until there are no more account numbers. Can some one please help?
A1 B1
Account NumberResult
11001696802
(FIRST RESULT)
10002370000

<tbody>
</tbody>


(other sheet)

CELL A2 is where I should paste the account number
CELL N1 is where the result appears
 

Some videos you may like

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

ranman256

Well-known Member
Joined
Jun 17, 2014
Messages
1,954
unclear.
cant you just copy the ACCT# column,
paste into a new sheet, the say remove duplicates? Is that what you want?
 

remejiah

New Member
Joined
Jul 13, 2016
Messages
17
I need it to copy the account number, paste it to another sheet where I have written numerous formulas to manipulate data and come up with a result. Then I want to copy that result and paste it next to the priginal account number. Then I want to move to the next account number in the column and repeat until there are no more account numbers.
 

remejiah

New Member
Joined
Jul 13, 2016
Messages
17
Macro Help - loop

WHAT I HAVE

I have a set of account numbers in a spreadsheet. They are on a sheet named 'data' in the A column beginning with cell A2.

On a separate sheet named 'configure' - I have written some formulas to do various calculations based on an account number. If the account number is pasted in cell A2 of the 'configure' sheet, then the desired result appears on the 'configure' sheet in cell N1.

WHAT I NEED

I need a way to build a loop macro that will cycle through the list of account numbers in column a, pasting them individually in the 'configure' sheet, yielding the result, copying the result, and pasting it into the cooresponding B column on the 'data sheet' (next to the original list of account numbers).

Ideally, I would like to be able to attach it to a macro button so that as I change the account numbers on the 'data' sheet, I can press the button, run the macro and get the result.

Thanks a million for any help that you can provide. I'm very good at formulas, but never learned much VBA code. Also if anyone can give a good tried and true resource to learn more of this, please let me know.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,519
Messages
5,596,635
Members
414,083
Latest member
Mrsash

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