ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copying value into alphanumeric table (https://www.excelbanter.com/excel-programming/339308-copying-value-into-alphanumeric-table.html)

Tre_cool[_6_]

copying value into alphanumeric table
 

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


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


Thanks in advance!
Trevo

--
Tre_coo
-----------------------------------------------------------------------
Tre_cool's Profile: http://www.excelforum.com/member.php...fo&userid=2641
View this thread: http://www.excelforum.com/showthread.php?threadid=44109


Tom Ogilvy

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" wrote in
message ...

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




Tre_cool[_7_]

copying value into alphanumeric table
 

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


--
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



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

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