Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Offset indeterminate amount

Hello

I have a cell selected, but I don't know where it will be and I want to go from it to the cell which is in the same row but in column M. Because of this, I can't use OFFSET(Y,X), because I won't know what X and Y will need to be.

Cheers
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Offset indeterminate amount

robzrob wrote:

I have a cell selected, but I don't know where it will be and I want to
go from it to the cell which is in the same row but in column M.
Because of this, I can't use OFFSET(Y,X), because I won't know what X
and Y will need to be.


Since it's *always* column M, you can hardcode that bit of info into your
formula/code.

As a spreadsheet formula, you could do something like this:
=INDIRECT(ADDRESS(ROW(),13))
(But test & adjust that to suit your needs; I'm not very good with
spreadsheet functions.)

In VBA, I'd probably do this:
Cells(ActiveCell.Row, 13).Select

For both VBA and spreadsheet formulae there are other ways; you might want to
do some investigating. Open the "insert function" dialog and search for
"offset" to start.

--
The cinema is not a slice of life but a piece of cake.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Offset indeterminate amount

On Sunday, 26 August 2012 20:17:59 UTC+1, Auric__ wrote:
robzrob wrote:



I have a cell selected, but I don't know where it will be and I want to


go from it to the cell which is in the same row but in column M.


Because of this, I can't use OFFSET(Y,X), because I won't know what X


and Y will need to be.




Since it's *always* column M, you can hardcode that bit of info into your

formula/code.



As a spreadsheet formula, you could do something like this:

=INDIRECT(ADDRESS(ROW(),13))

(But test & adjust that to suit your needs; I'm not very good with

spreadsheet functions.)



In VBA, I'd probably do this:

Cells(ActiveCell.Row, 13).Select



For both VBA and spreadsheet formulae there are other ways; you might want to

do some investigating. Open the "insert function" dialog and search for

"offset" to start.



--

The cinema is not a slice of life but a piece of cake.




Thank you, that looks as though it will do very well.
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 SUM for indeterminate number of rows? MrNobody Excel Worksheet Functions 5 February 20th 09 08:17 AM
Creating a subtotal for an indeterminate number of rows Kim1802 Excel Discussion (Misc queries) 0 November 24th 06 12:27 PM
indeterminate 0/0 integreat Excel Discussion (Misc queries) 6 July 31st 06 02:36 AM
How can I calculate amount of time left based on amount spent? KLD Excel Worksheet Functions 3 May 23rd 06 04:20 PM
Naming range where the no of rows indeterminate Feedsman Excel Programming 1 May 12th 06 05:45 PM


All times are GMT +1. The time now is 09:22 AM.

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"