Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Still having a problem checking cells

Here is my code:

For x = 11 To 298
If .Cells(x, skilly).Value = "x" Then
For y = timeStart To timeStart + 7
If .Cells(x, y).Value = "." _
And need 0 Then
.Cells(x, y).Value = skillNam
need = need - 1
End If
Next y
End If
Next x

It works fine, if the criteria is met it adds skillNam to each cell i
the row. However I only want it to add it if it can fill the whole row
A whole row can be from 32 to 44 cells. If the skill name can be place
in the whole row, I want to do it. Or else I want to continue down t
the next row and try again.

The code needs to be able to do something like xlright.
and fill the whole row if it meets the criteria

Thanks

Thank

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Still having a problem checking cells

Your code only fills at most 8 sequential cells.

How does that play into the 32 or 44?

How would one know whether the row was 32 or 44?

And you say fill, so see the first comment.

--
Regards,
Tom Ogilvy


"hotherps " wrote in message
...
Here is my code:

For x = 11 To 298
If .Cells(x, skilly).Value = "x" Then
For y = timeStart To timeStart + 7
If .Cells(x, y).Value = "." _
And need 0 Then
Cells(x, y).Value = skillNam
need = need - 1
End If
Next y
End If
Next x

It works fine, if the criteria is met it adds skillNam to each cell in
the row. However I only want it to add it if it can fill the whole row.
A whole row can be from 32 to 44 cells. If the skill name can be placed
in the whole row, I want to do it. Or else I want to continue down to
the next row and try again.

The code needs to be able to do something like xlright.
and fill the whole row if it meets the criteria

Thanks

Thanks


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Still having a problem checking cells

I guess the 8 cells is part of my problem then, because I want to fil
the cells in 32 , 44 consecutive cells at atime.


I need the code to add 32 or 44 cells if = "." which is just acting a
a placeholder.

That's my problem:
"How would one know whether the row was 32 or 44? (your post)

So somehow the code needs to look down the row andd see if there are a
least 32 or 44 cells if so fill the range even if it is greater tha
44.

Thanks Tom

Ji

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Still having a problem checking cells

For x = 11 To 298
If .Cells(x, skilly).Value = "x" Then
For y = timeStart To timeStart + 7
If application.Countif(.Cells(x, y).Resize(1,44),".") then
.Cells(x, y).Resize(1,44).Value = skillNam
elseif application.Countif(.Cells(x, y).Resize(1,32),".") then
.Cells(x, y).Resize(1,32).Value = skillNam
End If
Next y
End If
Next x


I don't know what roll need plays.

--
Regards,
Tom Ogilvy


"hotherps " wrote in message
...
I guess the 8 cells is part of my problem then, because I want to fill
the cells in 32 , 44 consecutive cells at atime.


I need the code to add 32 or 44 cells if = "." which is just acting as
a placeholder.

That's my problem:
"How would one know whether the row was 32 or 44? (your post)

So somehow the code needs to look down the row andd see if there are at
least 32 or 44 cells if so fill the range even if it is greater than
44.

Thanks Tom

Jim


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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Still having a problem checking cells

Whoops - if criteria was incomplete

For x = 11 To 298
If .Cells(x, skilly).Value = "x" Then
For y = timeStart To timeStart + 7
If application.Countif(.Cells(x, y).Resize(1,44),".") = 44 then
.Cells(x, y).Resize(1,44).Value = skillNam
elseif application.Countif(.Cells(x, y).Resize(1,32),".") = 32 then
.Cells(x, y).Resize(1,32).Value = skillNam
End If
Next y
End If

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
For x = 11 To 298
If .Cells(x, skilly).Value = "x" Then
For y = timeStart To timeStart + 7
If application.Countif(.Cells(x, y).Resize(1,44),".") then
.Cells(x, y).Resize(1,44).Value = skillNam
elseif application.Countif(.Cells(x, y).Resize(1,32),".") then
.Cells(x, y).Resize(1,32).Value = skillNam
End If
Next y
End If
Next x


I don't know what roll need plays.

--
Regards,
Tom Ogilvy


"hotherps " wrote in message
...
I guess the 8 cells is part of my problem then, because I want to fill
the cells in 32 , 44 consecutive cells at atime.


I need the code to add 32 or 44 cells if = "." which is just acting as
a placeholder.

That's my problem:
"How would one know whether the row was 32 or 44? (your post)

So somehow the code needs to look down the row andd see if there are at
least 32 or 44 cells if so fill the range even if it is greater than
44.

Thanks Tom

Jim


---
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
checking two different cells Stefan - AW Excel Worksheet Functions 1 September 7th 09 05:28 PM
IS BLANK checking 2 Cells MKuria Excel Worksheet Functions 6 March 6th 09 07:31 PM
Checking cells for 2 conditions Mary Lancaster Excel Worksheet Functions 3 July 21st 07 11:34 PM
Checking the Cells in Sheet1 with Cells in Sheet2 and replace Checking the cells in Sheet1 with Sheet2 Excel Worksheet Functions 1 August 19th 06 09:29 AM
Checking valus in cells Niklas[_3_] Excel Programming 3 August 8th 03 06:59 PM


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