Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Increment outer loops

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Increment outer loops

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Increment outer loops

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Increment outer loops

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Increment outer loops

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Increment outer loops

Yes it was Tom's Ken but thanks for your help also


---
Message posted from http://www.ExcelForum.com/

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Increment outer loops

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
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
outer join in query JD Excel Discussion (Misc queries) 0 June 10th 09 07:35 PM
How do you repeat outer row field in a pivot table down the row WINDMILL Excel Discussion (Misc queries) 1 March 5th 08 02:30 PM
Outer Joins The Rook[_2_] Excel Discussion (Misc queries) 3 March 15th 07 04:20 PM
MS Query Outer join with three tables Jim Excel Discussion (Misc queries) 0 February 15th 07 09:52 PM
Columns in Full Outer Joins David Weilmuenster Excel Programming 0 October 3rd 03 04:20 PM


All times are GMT +1. The time now is 12:42 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"