Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Initialize variable
I'm using the following code:
What I;m trying to do is add one more offset statement like this And .Cells(x, y).Offset(0, -8).Value < "IND" _ But from where the code starts I get an error because I'm using colum G to start, which is the 7th column. I can start this code as late a column O then there would be onough cells to look back -8. But I can't figure out how to do it. Thanks With Sheet236 For x = 11 To 298 counter = 8 For n = 1 To timeStart Next n If .Cells(x, skilly).Value = "x" And did = False Then For y = timeStart To timeStart + 7 If .Cells(x, y).Value = "." _ And counter < 9 _ And need 0 _ And x = 19 _ And .Cells(x, y).Value < "" _ And .Cells(x, y).Offset(-8, 0).Value < "IND" _ And .Cells(x, y).Offset(8, 0).Value < "IND" _ And .Cells(x, y).Offset(0, 8).Value < "IND" Then _ .Cells(x, y).Offset(0, 0).Resize(1, 8).Value = "ENG" '.Cells(x, y).Value = "ENG" counter = counter + 1 need = need - 8 End I -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Initialize variable
And .Cells(x, y).Offset(0, -1 * Application.Min(y-1,8)).Value < "IND"
-- Regards, Tom Ogilvy "hotherps " wrote in message ... I'm using the following code: What I;m trying to do is add one more offset statement like this And .Cells(x, y).Offset(0, -8).Value < "IND" _ But from where the code starts I get an error because I'm using column G to start, which is the 7th column. I can start this code as late as column O then there would be onough cells to look back -8. But I can't figure out how to do it. Thanks With Sheet236 For x = 11 To 298 counter = 8 For n = 1 To timeStart Next n If .Cells(x, skilly).Value = "x" And did = False Then For y = timeStart To timeStart + 7 If .Cells(x, y).Value = "." _ And counter < 9 _ And need 0 _ And x = 19 _ And .Cells(x, y).Value < "" _ And .Cells(x, y).Offset(-8, 0).Value < "IND" _ And .Cells(x, y).Offset(8, 0).Value < "IND" _ And .Cells(x, y).Offset(0, 8).Value < "IND" Then _ Cells(x, y).Offset(0, 0).Resize(1, 8).Value = "ENG" '.Cells(x, y).Value = "ENG" counter = counter + 1 need = need - 8 End If --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Initialize variable
Is there anything you don't know Tom?
Thanks so much that was perfect, I've been toying with it for hours. Thanks again! Ji -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Qn: Define a variable in Initialize for Userform | Excel Programming | |||
Initialize textbox values | Excel Programming | |||
need form to initialize without closing | Excel Programming | |||
Generic questions about variable scope the Initialize event | Excel Programming | |||
Initialize data in new row? | Excel Programming |