Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Qn: Define a variable in Initialize for Userform Michael Vaughan Excel Programming 4 August 21st 04 12:10 PM
Initialize textbox values phreud[_20_] Excel Programming 4 July 2nd 04 05:18 PM
need form to initialize without closing bruce forster Excel Programming 2 April 21st 04 11:57 PM
Generic questions about variable scope the Initialize event TBA[_2_] Excel Programming 4 January 12th 04 03:42 PM
Initialize data in new row? Ken[_12_] Excel Programming 1 August 9th 03 05:13 PM


All times are GMT +1. The time now is 08:13 AM.

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

About Us

"It's about Microsoft Excel"