Hi there,
I have written the following in relation to the attached spreadsheet (not VBA Code - If someone can convert it to VBA, then great.)
The structure is
a) Give a name to the instructions that follow under steps (b) to (e)
b) Find a row with particular cell contents and NAME it.
c) Find rows with particular cell contents that pass comparison rule#1 and NAME them.
d) Find rows with particular cell contents that pass comparison rule#2 and NAME them.
e) Use IF function based on result of Counting No. of rows from c) or d) to enter result
f) Loop instructions until type (b) rows no longer exist.
Three questions I have are:
1. What happens if there are no rows able to be named under step (b) which is the row type that everything else depends on? What instruction and where do I put it to get the macro move on to a completely new set of instructions?
2. Can a single row be able to be referred to by different names? ie. the name in step(c) and the name in step(d). I need this to be the case for my macro to work effectively.
3. If there are no rows found under (c), does the second part of the nested IF function from step(e) work? Is there a way of still allowing that second part of the nested IF function to work if the first part can't operate?
Macro is as follows:
NAME the instructions that follow as FIRSTFINALRATING
FIND the 1st row from the top
WHERE columnH=S & columnI=NB & columnJ=” ”[ie. blank]
NAME this row FirstNBRow
FIND the row(s) NOT FirstNBRow
WHERE (columnA, the row)=(columnA,FirstNBRow)
AND (columnB, the row)=(columnB.FirstBNRow)
AND (columnE, the row)=(columnE.FirstBNRow)
AND (columnI, the row)=”S”
AND (columnC, the row) < (columnC, FirstNBRow)
NAME this row(s) SlowFasterOT
FIND the row(s) NOT FirstNBRow
WHERE (columnA,the row)=(columnA,FirstNBRow)
AND (columnB,the row)=(columnB.FirstBNRow)
AND (columnH, the row)=”S”
AND (columnE, the row) => (columnF,FirstNBRow)
AND (columnD, the row) < (columnD, FirstNBRow)
NAME this row(s) SlowBandFasterST
FIND the row(s) NOT FirstNBRow
WHERE (columnA, the row)=(columnA,FirstNBRow)
AND (columnB, the row)=(columnB.FirstBNRow)
AND (columnH, the row)=”S”
AND (columnE, the row) => (columnF,FirstNBRow)
AND (columnC, the row) < (columnC, FirstNBRow)
NAME this row(s) SlowBandFasterOT
IF COUNTROWS(SlowFasterOT) >0,
AND
COUNTROWS(SlowBandFasterST) >1
THEN Select (columnJ,FirstNBRow) and enter “S”
OTHERWISE,
IF COUNTROWS(SlowBandFasterOT) >1
AND
COUNTROWS(SlowBandFasterOT) >1
THEN Select (columnJ,FirstNBRow) and enter “S”
OTHERWISE Select (columnJ,FirstNBRow) and enter “NB”
LOOP FIRSTFINALRATING UNTIL COUNTROWS(FirstNBRow) = 0
Bookmarks