Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
so columns A and B are the target cell's address, where column A is the
Column abd B is the Row, and the value for that cell is in column C so row 1 says that cell U10 has the value 10 and row 2 says cell U7 has the value 12 and so on ... Dim rowIndex As Long rowIndex = 1 Do Until Cells(rowIndex, "C") = "" Cells(Cells(rowIndex, "B").Value, Cells(rowIndex, "A").Value) = Cells(rowIndex, "C") rowIndex = rowIndex + 1 Loop "Sigmanut" wrote in message ... Veery interesting answers but I think I've not posed the question I meant to. It is really easier than you thought. I will restate and show my attempt at the answer. My problem is in the syntax as you will see. Thanks for the help. ' Given a spreadsheet like this: ' ' Starting Result ' A B C S T U V W '15 U 10 10 3 '16 U 7 12 4 14 '17 U 4 14 5 ' 6 ' 7 12 ' 8 ' 9 ' 10 10 ' 'Insert the contents of column C into the cell addressed by cells A & B. 'So the contents of U:10 is 10, U:7 is 12 and U:4 is 14. '----------------------------------------------------- 'In the sample data above the range is A:15 to C17 Dim mValue As Integer Dim mRow As Integer Dim mCol As String Dim mIdx As Integer For mIdx = 15 To 17 mCol = Range("A" & mIdx).Value ' mCol should = "U" mRow = Range("B" & mIdx).Value ' mRow should = 10 mValue = Range("C" & mIdx).Value ' mValue should = 10 Range(mCol&mRow).Value = mValue ' cell U10 should = 10 Next mIdx End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Odd Dynamic Range Question | Excel Discussion (Misc queries) | |||
dynamic range question | Excel Programming | |||
Dynamic range question | Excel Discussion (Misc queries) | |||
dynamic range question | Excel Programming | |||
Question regarding dynamic range setting | Excel Worksheet Functions |