Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Range offset

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Range offset

ActiveCell.Offset(-1, -10).Select

Regards,
Paul

"jsd219" wrote in message
oups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Range offset

ok, what am i doing wrong here?

Set rng = ActiveCell.Offset(-1, -10).Select

i get an error

God bless
jsd219


PCLIVE remove this wrote:
ActiveCell.Offset(-1, -10).Select

Regards,
Paul

"jsd219" wrote in message
oups.com...
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Range offset

you don't use select at the end

Set rng = ActiveCell.Offset(-1, -10)
rng.Select

but you rarely need to select, you can just act on the rng
--


Gary


"jsd219" wrote in message
ups.com...
ok, what am i doing wrong here?

Set rng = ActiveCell.Offset(-1, -10).Select

i get an error

God bless
jsd219


PCLIVE remove this wrote:
ActiveCell.Offset(-1, -10).Select

Regards,
Paul

"jsd219" wrote in message
oups.com...
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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 200
Default Range offset

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Range offset

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


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Range offset

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




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Range offset

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



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Range offset

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





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
OFFSET Range Daniel Excel Worksheet Functions 1 October 18th 07 03:12 PM
Copy range using offset range value caroline Excel Programming 2 February 16th 06 02:51 PM
Problem with Range.Cells.Offset and Range.Cells( row + offset, column) [email protected] Excel Programming 2 August 22nd 05 05:25 AM
range offset bbxrider[_2_] Excel Programming 7 July 20th 05 10:10 AM
Offset Range hotherps[_113_] Excel Programming 11 August 20th 04 12:38 AM


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