LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default dynamic range question

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Odd Dynamic Range Question Bongard Excel Discussion (Misc queries) 6 January 7th 10 07:21 PM
dynamic range question Jacob Skaria Excel Programming 0 May 15th 09 01:56 PM
Dynamic range question Guy Normandeau Excel Discussion (Misc queries) 13 August 2nd 06 07:31 AM
dynamic range question Robin Excel Programming 4 September 21st 05 11:36 PM
Question regarding dynamic range setting dharmik Excel Worksheet Functions 2 July 22nd 05 08:44 PM


All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"