Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default One works - One does not?

This code places a value in the eigth cell of a row. Then it drops t
the next row. In the second row it should put the value in the 16t
cell. It should then continue on with a few more intervals. But I ca
only get the first one to work.

If .Cells(x, skilly).Value = "x" And did = False Then
For y = timeStart To timeStart + 7 'added line wit
offset1
If .Cells(x, y).Offset(0, 7).Value = "." _
And .Cells(x, y).Value = "." _
And counter = 8 _
And need 0 Then
.Cells(x, y).Offset(0, 0).Resize(1, 8).Value
"IND"
.Cells(x, y).Offset(0, 8).Value = "Brk"

If .Cells(x, y).Offset(0, 15).Value = "." _
And .Cells(x, y).Value = "." _
And counter = 8 _
And need 0 Then
.Cells(x, y).Offset(0, 0).Resize(1, 15).Value
"IND"
.Cells(x, y).Offset(0, 16).Value = "Lun"
.Cells(x, y).Offset(0, 17).Value = "Lun"
counter = counter + 1
need = need -

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default One works - One does not?

This line
Cells(x, y).Offset(0, 0).Resize(1, 8).Value =
"IND"

Puts "IND"
in Cells(x,y).offset(0,0)

your next if statements says do something only if
And .Cells(x, y).Value = "." _

..cells(x,y) and cells(x,y).offset(0,0) refer to the same cell which now has
the value "IND", not "."

Also, based on your code I still don't see why you have the loop

For y = timeStart To timeStart + 7

--
Regards,
Tom Ogilvy


"hotherps " wrote in message
...
This code places a value in the eigth cell of a row. Then it drops to
the next row. In the second row it should put the value in the 16th
cell. It should then continue on with a few more intervals. But I can
only get the first one to work.

If .Cells(x, skilly).Value = "x" And did = False Then
For y = timeStart To timeStart + 7 'added line with
offset1
If .Cells(x, y).Offset(0, 7).Value = "." _
And .Cells(x, y).Value = "." _
And counter = 8 _
And need 0 Then
Cells(x, y).Offset(0, 0).Resize(1, 8).Value =
"IND"
Cells(x, y).Offset(0, 8).Value = "Brk"

If .Cells(x, y).Offset(0, 15).Value = "." _
And .Cells(x, y).Value = "." _
And counter = 8 _
And need 0 Then
Cells(x, y).Offset(0, 0).Resize(1, 15).Value =
"IND"
Cells(x, y).Offset(0, 16).Value = "Lun"
Cells(x, y).Offset(0, 17).Value = "Lun"
counter = counter + 1
need = need - 8


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default One works - One does not?

Thanks Tom, that makes sense.

Timestart referes to a seperate Public Sub, it just divides 24 hour
into 12 2 hour periods. It plays a role in placing the groups of
cells into certain areas.

THank

--
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
Need help on how it works.... deepak Excel Discussion (Misc queries) 1 January 28th 09 08:01 AM
It works but why...? will Links and Linking in Excel 13 October 14th 05 05:39 PM
How do I convert works file to excel without works software? CatMB Excel Discussion (Misc queries) 1 June 21st 05 04:12 PM
Something works, something don't. y Excel Programming 2 April 7th 04 08:26 AM
MS Works and VB Tim Childs Excel Programming 3 September 28th 03 08:56 PM


All times are GMT +1. The time now is 12:17 PM.

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"