#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 109
Default Cell Referencing

Dear all,

Is it possible to reference cells in Excel using numbers for both rows and
columns rather than the letter and number reference as is standard?

If so, is it possible to write a macro that selects range A1 to A+X:1+Y
where X & Y are variable integers in other cells?


Thanking-you in advance,

Neil


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Cell Referencing

Using macros you cna reference cells either using numbers or letters. Cells
can ber referenced using eithe rRANGE or CELLS. Here are some examples

Range("A1:B10")
Cells(1,"B") row then column
Cells(1,2)
Range(cells(1,"A"),cells(10,"C")

for you case use the following
Range("A1",cells(X + 1, Y + 1))


"Neil Pearce" wrote:

Dear all,

Is it possible to reference cells in Excel using numbers for both rows and
columns rather than the letter and number reference as is standard?

If so, is it possible to write a macro that selects range A1 to A+X:1+Y
where X & Y are variable integers in other cells?


Thanking-you in advance,

Neil


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 109
Default Cell Referencing

Thanks Joel.

So if I wanted a simple macro code to attach to a button to select a range,
as dictated by cells Z1 & Z2, the following should work?

sub SelectRange()

range("A1",cells((Z1+1),(Z2+1))).select
end sub


Kind regards,

Neil

"Joel" wrote:

Using macros you cna reference cells either using numbers or letters. Cells
can ber referenced using eithe rRANGE or CELLS. Here are some examples

Range("A1:B10")
Cells(1,"B") row then column
Cells(1,2)
Range(cells(1,"A"),cells(10,"C")

for you case use the following
Range("A1",cells(X + 1, Y + 1))


"Neil Pearce" wrote:

Dear all,

Is it possible to reference cells in Excel using numbers for both rows and
columns rather than the letter and number reference as is standard?

If so, is it possible to write a macro that selects range A1 to A+X:1+Y
where X & Y are variable integers in other cells?


Thanking-you in advance,

Neil


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Cell Referencing

Yes.

Tools/ Options/ General:
R1C1 reference style.
--
David Biddulph

"Neil Pearce" wrote in message
...
Dear all,

Is it possible to reference cells in Excel using numbers for both rows and
columns rather than the letter and number reference as is standard?

....


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Cell Referencing

I thinbk the code below is what you want. You don't havbe Z1 and Z2 defined.
I thionk you are referencing the workbook cells Z1 and Z2, therfore, you
need to use range.

sub SelectRange()

range("A1",cells((Range("Z1")+1),(Range("Z2")+1))) .select
end sub


"Neil Pearce" wrote:

Thanks Joel.

So if I wanted a simple macro code to attach to a button to select a range,
as dictated by cells Z1 & Z2, the following should work?

sub SelectRange()

range("A1",cells((Z1+1),(Z2+1))).select
end sub


Kind regards,

Neil

"Joel" wrote:

Using macros you cna reference cells either using numbers or letters. Cells
can ber referenced using eithe rRANGE or CELLS. Here are some examples

Range("A1:B10")
Cells(1,"B") row then column
Cells(1,2)
Range(cells(1,"A"),cells(10,"C")

for you case use the following
Range("A1",cells(X + 1, Y + 1))


"Neil Pearce" wrote:

Dear all,

Is it possible to reference cells in Excel using numbers for both rows and
columns rather than the letter and number reference as is standard?

If so, is it possible to write a macro that selects range A1 to A+X:1+Y
where X & Y are variable integers in other cells?


Thanking-you in advance,

Neil




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 109
Default Cell Referencing

Yes Z1 and Z2 are indeed reference to cells in the workbook, apologies for
the lack of clarification.

The code below halts at the second range and returns "wrong number of
arguments or invalid property asignment". Any ideas?



"Joel" wrote:

I thinbk the code below is what you want. You don't havbe Z1 and Z2 defined.
I thionk you are referencing the workbook cells Z1 and Z2, therfore, you
need to use range.

sub SelectRange()

range("A1",cells((Range("Z1")+1),(Range("Z2")+1))) .select
end sub


"Neil Pearce" wrote:

Thanks Joel.

So if I wanted a simple macro code to attach to a button to select a range,
as dictated by cells Z1 & Z2, the following should work?

sub SelectRange()

range("A1",cells((Z1+1),(Z2+1))).select
end sub


Kind regards,

Neil

"Joel" wrote:

Using macros you cna reference cells either using numbers or letters. Cells
can ber referenced using eithe rRANGE or CELLS. Here are some examples

Range("A1:B10")
Cells(1,"B") row then column
Cells(1,2)
Range(cells(1,"A"),cells(10,"C")

for you case use the following
Range("A1",cells(X + 1, Y + 1))


"Neil Pearce" wrote:

Dear all,

Is it possible to reference cells in Excel using numbers for both rows and
columns rather than the letter and number reference as is standard?

If so, is it possible to write a macro that selects range A1 to A+X:1+Y
where X & Y are variable integers in other cells?


Thanking-you in advance,

Neil


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
Referencing a cell. PAL Excel Discussion (Misc queries) 1 January 23rd 08 01:15 AM
Cell Referencing Tim Caldwell[_2_] Excel Discussion (Misc queries) 3 July 3rd 07 08:56 PM
Referencing Cell Next To Today's Date Cell Docktondad Excel Discussion (Misc queries) 5 May 16th 07 10:25 PM
Cell referencing SC [email protected] Excel Discussion (Misc queries) 1 March 3rd 07 08:48 AM
Cell Referencing Bismark Excel Worksheet Functions 4 December 13th 06 09:36 PM


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