Thread: Range offset
View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
jsd219 jsd219 is offline
external usenet poster
 
Posts: 68
Default Range offset

If the match is made in F it should just place an "x" in the same
column (F) but i was only planning on using this for a small segment of
the script. I am trying to figure this part out for two reasons, to
keep moving forward tonight and to learn how to do this. :-)

The plan i have for this script is to be called by another script that
searches the cells for specific criteria i.e All CAPS or Starts with a
number, etc. once it finds the proper cell then it will, hopefully,
call up this script to place an "x" in the appropriate place.

The hardest task so far is figuring out the rules to search for, for
instance:

STANDARDS FOR FOREIGN LANGUAGE LEARNING
Vocabulario en acción 1
Communication 1.1 Students engage in conversations

i can easily find All CAPS and "Word Space NumberDotumber but the
middle cell is the hardest. I have started to conclude after all of
this that i might have to have the script start at a starting position
and work its way down the column checking each cell not only for a
series of rules but then comparing to the cell above and below. In
other words, when the script comes to (in the above example) the middle
cell (Vocab) it will have to check to see if it is all CAPS or has
NumberDotNumber, if it does not it then it checks the cell above,
(STANDARDS) if the cell above is All CAPS i now know that the cell
(Vocab)'s "x" will fall in the tier one column to the right of whatever
tier the cell above (STANDARDS) is.

I have a few main rules that everything will fall under.
Cell = Chapter #
Cell contains = DAY or BLOCK
First word or entire contents = All CAPS or the Text "Pre-AP Practice"
First word = (# min.) i.e (3 min.) or (7 min)
Cell contains = (Word Space NumberDotNumber)

Any help with this would be awesome. i am way over my head.

God bless
jsd219

Tom Ogilvy wrote:
Dim rng as Range, rng1 as Range
Dim res as variant
set rng = cells.Find("Went up the hill")
set rng1 = cells(rng.row-1,"A").resize(1,6)
res = application.Match("x",rng1,0)
if not iserror(res) then
cells(rng.row,res + 1).Value = "x"
end if

What happends if the match was made in F; write to G?


What happended to Don?

--
Regards,
Tom Ogilvy



"jsd219" wrote in message
ups.com...
Sure this is a post from an earlier thread:

I am trying to write a script that looks for a cell with specified text
in a specified column, once it finds the cell it needs to check six
different columns (a,b,c,d,e,f) one row above and find the column that
has an "x", it then needs to place an "x" in its row one column to the
right from the previous "x"

example: if it finds the cell with "Went up the hill" the script needs
to look up one row and check columns (a,b,c,d,e,f) until it finds the
"X".

In this case it will find the "X" on the row with "JACK AND JILL" in
column "a" so it will place an "X" for the row "Went up the hill" (the
orginal cell searched for) in column "b"

a b c d e f g
X JACK AND JILL

Went up the hill

To fetch 3.5 Pales

God bless
jsd219


Gary Keramidas wrote:
give us an example of exactly what you're trying to do

--


Gary


"jsd219" wrote in message
ups.com...
Here is a problem i am having, i need to not only make the range start
one row above the selected cell but i also need it to cover multiple
columns. any ideas?

God bless
jsd219

Alan Beban wrote:
Set rng = ActiveCell(0, -9)

Alan Beban

jsd219 wrote:
Can anyone tell me how to set a range offset? i am trying to write a
script that will start from the active cell and perform an action 1
row
above and several columns to the left.

example:

if cell "N100" is the active cell my script will go up to "N99" and
over to column "D" then perform its action.

God bless
jsd219