Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Cell Reference to a location

In a macro or formula, how do I make a reference to a cell by location?
i.e. 3 cells to the left and up one row?

Thanks,

Barney


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Cell Reference to a location

Barney

Activecell.Offset(-3,-1)

Be aware you may raise an error if this reference doesn't exist



--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Barney" wrote in message
...
In a macro or formula, how do I make a reference to a cell by location?
i.e. 3 cells to the left and up one row?

Thanks,

Barney



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Cell Reference to a location

Barney

Use the OFFSET worksheet function

=SUM(B2:OFFSET(E30,-1,-3))

Would sum up B2:B29...........B29 is OFFSET from E30 by one row up(29) and 3
columns left(B)

Macro.............

Sub Test()
Set qwerty = ActiveCell.Offset(-1, -3)
MsgBox qwerty.Address
End Sub

Gord Dibben Excel MVP

On Mon, 13 Dec 2004 17:43:51 -0500, "Barney" wrote:

In a macro or formula, how do I make a reference to a cell by location?
i.e. 3 cells to the left and up one row?

Thanks,

Barney


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Cell Reference to a location

I have tried to use OFFSET in a macro to no avail. Here is what I am trying
to do. I have about 50 golfers. Their names are in Col A. Columns B-G are
set up with their last six scores (if they have that many). When any one
golfer plays his 7th round, I want to 'cut and paste' his last 5 scores to
replace the first 5 scores. This leaves a space to enter a new "6th" score.
With those scores I will calculate a handicap for each golfer.

I want to use a macro (with button) to activate the 'cut and paste'
operation. Not all golfers play each time so I want a button for each
golfer but only one macro in the spreadsheet so it doesn't get too large.

I am using Win XP and Excel 2002.

Thanks for your previous answer and any other help you can offer.

Barney




"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Barney

Use the OFFSET worksheet function

=SUM(B2:OFFSET(E30,-1,-3))

Would sum up B2:B29...........B29 is OFFSET from E30 by one row up(29) and
3
columns left(B)

Macro.............

Sub Test()
Set qwerty = ActiveCell.Offset(-1, -3)
MsgBox qwerty.Address
End Sub

Gord Dibben Excel MVP

On Mon, 13 Dec 2004 17:43:51 -0500, "Barney" wrote:

In a macro or formula, how do I make a reference to a cell by location?
i.e. 3 cells to the left and up one row?

Thanks,

Barney




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
Reference Worksheet Location from web rKeen Links and Linking in Excel 0 October 22nd 09 12:21 AM
Cell Location Reference Roy A.[_2_] Excel Discussion (Misc queries) 2 March 26th 09 12:01 AM
Creating a linked file based on variable location reference Monk[_2_] Excel Discussion (Misc queries) 2 May 18th 08 10:47 AM
Cell Reference Location CWillis Excel Discussion (Misc queries) 2 June 7th 06 07:54 PM
Reference cell location Dan Excel Worksheet Functions 7 March 1st 06 04:18 AM


All times are GMT +1. The time now is 04:47 PM.

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"