+ Reply to Thread
Results 1 to 2 of 2

problems with loop

Hybrid View

  1. #1
    Arjan
    Guest

    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!

  2. #2
    chijanzen
    Guest

    RE: 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!


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1