PDA

View Full Version : looping help for copying data from a range and paste in another cell



aravindhan_3
12-21-2015, 01:47 AM
Hi,

I have dashboard , which is calculated based on the value entered in cell B2. I enter the country name there and the entire dashboard populates, after it populates i move the sheet to a new workbook and converts them into values and save the file.
i have about 50 countires, so i have to do this 50 times.

I can easily record/write a macro for moving, converting n saving as a different file, i need your help for a macro which run this like a loop.

for example i will save all 50 countries name in sheet 2 Column A ( starts from A2) so if a macro copies each values from there ans paste in sheet 1 B2, then run my code for all these 50 countries.

Thanks for your help in advance.

cross post : http://www.mrexcel.com/forum/excel-questions/909571-looping-help-copying-data-range-paste-another-cell.html

Regards
Arvind

Bob Phillips
12-21-2015, 05:50 AM
Coding steps, you can convert as yyiu say you can easily create VBA

Get lastrow of country list
Loop all rows of country list (For i = 1 to countrylist.lastrow)

Move country to cell B2

Populate dashboard

Move values

save file

Next country