Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Not sure how to handle this

IND will only appear in 8 cells per row, and it might not be every row


After 8 cells are found the code should apply the same conditions bu
offset them -1. I can only have IND in four colunms at a time.

When it drops down after the 4 column has eight cells, it should plac
Brk -1 from the next cell that has IND in it.


I also need to know how many cells have "." in them before a cell wit
IND is reached. The scheme will change based on the number of cell
with "." in them. I can't seem to get a counter to do this.

I just need to be able to count the "." before each group of INDS i
found.

Kind of hard to explain..

Thanks


Dim cell As Range, cell1 As Range
Dim bLunchDue As Boolean, bHadLunch As Boolean
Dim l As Integer
Dim i As Integer
For Each cell In Range("G11:G298")
i = 1
bLunchDue = False
bHadLunch = False
' now walk across the row or reference cells in the row.
For Each cell1 In cell.Resize(1, 96 - 7)
If Application.CountIf(cell1.Resize(1, 8), "IND") = 8 Then
If bLunchDue Then
cell1.Offset(0, 8).Value = "lun"
bLunchDue = False
bHadLunch = True

Else
cell1.Offset(0, 8).Value = "brk"
If Not bHadLunch Then bLunchDue = True
End If
End If

Next
Nex

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Not sure how to handle this

Herps,

You have been asking questions about this for some weeks now, and struggling
all the time to explain it (personally I gave up ages ago when I couldn't
determine whether you wanted 1, none, 4, 8, whether it was OFFSET or
including, etc., etc.)

It would seem to me to suggest that your design is wrong and you may be
better to look afresh at your requirement and see if it can be cut another
way.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"hotherps " wrote in message
...
IND will only appear in 8 cells per row, and it might not be every row.


After 8 cells are found the code should apply the same conditions but
offset them -1. I can only have IND in four colunms at a time.

When it drops down after the 4 column has eight cells, it should place
Brk -1 from the next cell that has IND in it.


I also need to know how many cells have "." in them before a cell with
IND is reached. The scheme will change based on the number of cells
with "." in them. I can't seem to get a counter to do this.

I just need to be able to count the "." before each group of INDS is
found.

Kind of hard to explain..

Thanks


Dim cell As Range, cell1 As Range
Dim bLunchDue As Boolean, bHadLunch As Boolean
Dim l As Integer
Dim i As Integer
For Each cell In Range("G11:G298")
i = 1
bLunchDue = False
bHadLunch = False
' now walk across the row or reference cells in the row.
For Each cell1 In cell.Resize(1, 96 - 7)
If Application.CountIf(cell1.Resize(1, 8), "IND") = 8 Then
If bLunchDue Then
cell1.Offset(0, 8).Value = "lun"
bLunchDue = False
bHadLunch = True

Else
cell1.Offset(0, 8).Value = "brk"
If Not bHadLunch Then bLunchDue = True
End If
End If

Next
Next


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Not sure how to handle this

Hotherps,

I'll have a look at it if you email me a sample workbook.
Required is that the workbook have one worksheet with the
data arranged in a BEFORE state and another worksheet with
the data arranged in the AFTER state. Also required is a
simple explanation (starting from scratch) as to what you
want the macro to do. Note that the main challenge appears
to be understanding what it is you are trying to do rather
than how to achieve it - not to imply that the latter is
simplistic.

The word EXCEL should be included in the email subject.
Remove "nospam" from my email address. No guarantees.

Regards,
Greg
(VBA amateur)




-----Original Message-----
IND will only appear in 8 cells per row, and it might not

be every row.


After 8 cells are found the code should apply the same

conditions but
offset them -1. I can only have IND in four colunms at a

time.

When it drops down after the 4 column has eight cells, it

should place
Brk -1 from the next cell that has IND in it.


I also need to know how many cells have "." in them

before a cell with
IND is reached. The scheme will change based on the

number of cells
with "." in them. I can't seem to get a counter to do

this.

I just need to be able to count the "." before each group

of INDS is
found.

Kind of hard to explain..

Thanks


Dim cell As Range, cell1 As Range
Dim bLunchDue As Boolean, bHadLunch As Boolean
Dim l As Integer
Dim i As Integer
For Each cell In Range("G11:G298")
i = 1
bLunchDue = False
bHadLunch = False
' now walk across the row or reference cells in the row.
For Each cell1 In cell.Resize(1, 96 - 7)
If Application.CountIf(cell1.Resize(1, 8), "IND") = 8 Then
If bLunchDue Then
cell1.Offset(0, 8).Value = "lun"
bLunchDue = False
bHadLunch = True

Else
cell1.Offset(0, 8).Value = "brk"
If Not bHadLunch Then bLunchDue = True
End If
End If

Next
Next


---
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
How to handle something like this DK Excel Discussion (Misc queries) 0 May 19th 09 11:40 PM
what is "fill handle". i don't see any fill handle in my excel Neelakanta New Users to Excel 32 June 18th 08 12:48 PM
Fill handle turned into a move handle Northwoods Excel Discussion (Misc queries) 1 March 2nd 07 03:40 PM
handle #VALUE exception Andis Cirulis Excel Worksheet Functions 2 November 13th 06 11:32 AM
Printer name from handle Eje Excel Programming 2 December 15th 03 04:48 PM


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