+ Reply to Thread
Results 1 to 3 of 3

copying value into alphanumeric table

  1. #1
    Registered User
    Join Date
    08-18-2005
    Posts
    22

    copying value into alphanumeric table

    Hi,
    I've spent hours trying to work this out and I can't get it. I need some help to copy a value and grid location into a table in another worksheet. For example, in one worksheet I have in one cell, the table location (i.e C3), and in another cell a number (ie. 1234). On a second sheet, I have a table and I would like it to copy 1234 into table location, C3. Note, on the first sheet the number and table location values are changing (table location is a manual input). Eventually, I would enter many grid locations in sheet1 and a corresponding value appears in the second cell and then I would like a macro that will fill in the table in sheet2.


    Eg.
    Sheet1 Sheet2
    A B C A B C
    1 C3 1
    2 1234 2
    3 3 (want 1234 to copy here)
    4 4
    5 5


    Thanks in advance!
    Trevor

  2. #2
    Tom Ogilvy
    Guest

    Re: copying value into alphanumeric table

    Sub UpdateTable()
    Dim rng as Range, cell as Range
    With Worksheets("sheet1")
    set rng = .Range(.Cells(1,1),.Cells(1,1).End(xldown))
    End With
    for each cell in rng
    worksheets("Sheet2").Range(cell.Value).value = _
    cell.offset(0,1).Value
    Next
    End Sub
    --
    Regards,
    Tom Ogilvy


    "Tre_cool" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi,
    > I've spent hours trying to work this out and I can't get it. I need
    > some help to copy a value and grid location into a table in another
    > worksheet. For example, in one worksheet I have in one cell, the table
    > location (i.e C3), and in another cell a number (ie. 1234). On a second
    > sheet, I have a table and I would like it to copy 1234 into table
    > location, C3. Note, on the first sheet the number and table location
    > values are changing (table location is a manual input). Eventually, I
    > would enter many grid locations in sheet1 and a corresponding value
    > appears in the second cell and then I would like a macro that will fill
    > in the table in sheet2.
    >
    >
    > Eg.
    > Sheet1 Sheet2
    > A B C A B C
    > 1 C3 1
    > 2 1234 2
    > 3 3 (want
    > 1234 to copy here)
    > 4 4
    > 5 5
    >
    >
    > Thanks in advance!
    > Trevor
    >
    >
    > --
    > Tre_cool
    > ------------------------------------------------------------------------
    > Tre_cool's Profile:

    http://www.excelforum.com/member.php...o&userid=26416
    > View this thread: http://www.excelforum.com/showthread...hreadid=441098
    >




  3. #3
    Registered User
    Join Date
    08-18-2005
    Posts
    22
    Thanks Tom...it almost worked, but I'm getting a run-time error in the line,

    worksheets("Sheet2").Range(cell.Value).value = cell.offset(0,1).Value

    I don't want it to loop down cells in sheet1 just the pair of cells telling it, which cell to put it into table and the value.
    Eg. C4
    12345


    Thanks

+ 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