Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm having a problem with the values K and T
For K = 305 To 316 For t = 319 To 330 For Each cell In Range("G11:N298") c = Array(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) For i = 0 To 13 If Cells(t, c(i)).Value - 1 = Cells(K, c(i)) And Cells(cell.Row, c(i) + 97) = "x" Then cell.Value = Cells(9, c(i) + 97) End If Next i Next After the array and the rest of the code has finished I want t increase the value of K by one and the value of T by one. No matte where I put it I get an error. What am I missing? Thank -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Will this work for you?
For K = 305 To 316 For Each cell In Range("G11:N298") c = Array(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) For i = 0 To 13 If Cells(K + 14, c(i)).Value - 1 = Cells(K, c (i)) And Cells(cell.Row, c(i) + 97) = "x" Then cell.Value = Cells(9, c(i) + 97) End If Next i Next K -----Original Message----- I'm having a problem with the values K and T For K = 305 To 316 For t = 319 To 330 For Each cell In Range("G11:N298") c = Array(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) For i = 0 To 13 If Cells(t, c(i)).Value - 1 = Cells(K, c(i)) And Cells(cell.Row, c(i) + 97) = "x" Then cell.Value = Cells(9, c(i) + 97) End If Next i Next After the array and the rest of the code has finished I want to increase the value of K by one and the value of T by one. No matter where I put it I get an error. What am I missing? Thanks --- Message posted from http://www.ExcelForum.com/ . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I thought I had tried that? But I must have been missing something. You
code ran fine. I have one more question if you don't mind. I have twelve ranges to run this code through. Each time K and increment, it should move to the next range. It is in steps of 8 and i starts in column 7 and ends in column 102 Is there an easy way to incorporate this? Thanks again -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That worked fine, I thought I had it that way at one point but I gues
not. One more quick question if you don't mind. I would like to run the cod through 12 ranges each time incrementinh T and K would this be difficul to incorporate? The columns would be from 7 to 102 with a step of 8 I'm not sure how to phrase it? Thanks agai -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Are you referring to my code or to Tom's?
We had different approaches to your question and mine was missing a "Next cell" line of code. So, I was guessing that, if it ran fine, it was Tom's. -----Original Message----- That worked fine, I thought I had it that way at one point but I guess not. One more quick question if you don't mind. I would like to run the code through 12 ranges each time incrementinh T and K would this be difficult to incorporate? The columns would be from 7 to 102 with a step of 8 I'm not sure how to phrase it? Thanks again --- Message posted from http://www.ExcelForum.com/ . |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes it was Tom's Ken but thanks for your help also
--- Message posted from http://www.ExcelForum.com/ |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For K = 305 To 316
For t = 319 To 330 For Each cell In Range("G11:N298") c = Array(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) For i = 0 To 13 If Cells(t, c(i)).Value - 1 = Cells(K, c(i)) And _ Cells(cell.Row, c(i) + 97) = "x" Then cell.Value = Cells(9, c(i) + 97) End If Next i Next cell Next t Next K -- Regards, Tom Ogilvy "hotherps " wrote in message ... I'm having a problem with the values K and T For K = 305 To 316 For t = 319 To 330 For Each cell In Range("G11:N298") c = Array(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) For i = 0 To 13 If Cells(t, c(i)).Value - 1 = Cells(K, c(i)) And Cells(cell.Row, c(i) + 97) = "x" Then cell.Value = Cells(9, c(i) + 97) End If Next i Next After the array and the rest of the code has finished I want to increase the value of K by one and the value of T by one. No matter where I put it I get an error. What am I missing? Thanks --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
outer join in query | Excel Discussion (Misc queries) | |||
How do you repeat outer row field in a pivot table down the row | Excel Discussion (Misc queries) | |||
Outer Joins | Excel Discussion (Misc queries) | |||
MS Query Outer join with three tables | Excel Discussion (Misc queries) | |||
Columns in Full Outer Joins | Excel Programming |