ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   problems with loop (https://www.excelbanter.com/excel-programming/347600-problems-loop.html)

Arjan

problems with loop
 
I've a problem and no clue how to solve this.
I've a table with 3 columns (A:C). Column A is contains a name (sheetname),
column B a cell (C20) and column C a value.

I want to value of C1, in the cell of B1 on sheet A1 and so on, till the end
of the table. I was struggling with the loop (end of table / end of range?).

Example of table:
ColumnA-ColumnB-ColumnC
sheet1-C20-Jan
sheet2-B20-Karin
sheet1-C21-Doug
etc.

Thanks for your help!

chijanzen

problems with loop
 
Arjan:

try,

i = 1
Do While Sheet1.Cells(i, 1) < ""
shtname = Sheet1.Cells(i, 1)
Worksheets(shtname).Range(Sheet1.Cells(i, 2)) = _
Sheet1.Cells(i, 3)
i = i + 1
Loop

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Arjan" wrote:

I've a problem and no clue how to solve this.
I've a table with 3 columns (A:C). Column A is contains a name (sheetname),
column B a cell (C20) and column C a value.

I want to value of C1, in the cell of B1 on sheet A1 and so on, till the end
of the table. I was struggling with the loop (end of table / end of range?).

Example of table:
ColumnA-ColumnB-ColumnC
sheet1-C20-Jan
sheet2-B20-Karin
sheet1-C21-Doug
etc.

Thanks for your help!



All times are GMT +1. The time now is 08:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com