Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default How to reference Cells AA and forward with CHAR (and a bonus quest

I am in a position where I want to reference cells with 11 columns in between
them, i.e. if I first reference Cell A4 I then want to reference Cell M4 and
then Cell Y4 and so on. The first cell would then be Cell =CHAR(65)&4
Obviously you can guess what the problem is, since character there is no CHAR
value for AA or AB - the closest I get is =CHAR(65)&CHAR(65). So how do I set
it up so that I can make a CHAR-reference to cell AA1 without using two CHAR
commands?

For simplicity's sake: =CHAR(65+12*B1)&1 where B1=3 returns lower case "e"
and 1 where I would want it to return AK and 1.

Second question, somewhat related: what am I doing wrong with
=INDIRECT("CHAR("&65&")")

or for that matter

=INDIRECT("CHAR(65)")

I want both of these to resolve as CHAR(65) - i.e. capital "A" - but instead
I get #REF!

I'm sure these are newbie questions, but my first browse through the forums
didn't find me the answers so I'm hoping someone will have the time to answer
them. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 266
Default How to reference Cells AA and forward with CHAR (and a bonus quest

Here is a UDF (User Defined Function) which will return the column. Go to
Tools - Macros - Visual Basic Editor - and paste it in to a module. Then go
to File - Close and return to microsoft Excel. You can then use the =COL()
function. Also try something like =INDIRECT(CHAR(65)&1) - this will display
the contents of cell "A1" Let me know if I've confused you. Here is the UDF:

Function Col(Optional Column As Integer)

' This Function is used to return the column of a cell - useful for
"INDIRECT" function
' Typical use is =col(Column(AM1)) - this would return the value "AM"
' Can be called as col() which returns the column of the current cell
' Alternatively

Select Case Column

Case Is 0
FC = Chr(Int((Column - 1) / 26) + 64)
SC = Chr(((Column - 1) Mod 26) + 65)
If Column < 27 Then
Col = SC
Else
Col = FC + SC
End If
Case Is = 0

Addr = Application.Caller.Address
Col = Split(Addr, "$")(1)
End Select
End Function



"Babymech" wrote:

I am in a position where I want to reference cells with 11 columns in between
them, i.e. if I first reference Cell A4 I then want to reference Cell M4 and
then Cell Y4 and so on. The first cell would then be Cell =CHAR(65)&4
Obviously you can guess what the problem is, since character there is no CHAR
value for AA or AB - the closest I get is =CHAR(65)&CHAR(65). So how do I set
it up so that I can make a CHAR-reference to cell AA1 without using two CHAR
commands?

For simplicity's sake: =CHAR(65+12*B1)&1 where B1=3 returns lower case "e"
and 1 where I would want it to return AK and 1.

Second question, somewhat related: what am I doing wrong with
=INDIRECT("CHAR("&65&")")

or for that matter

=INDIRECT("CHAR(65)")

I want both of these to resolve as CHAR(65) - i.e. capital "A" - but instead
I get #REF!

I'm sure these are newbie questions, but my first browse through the forums
didn't find me the answers so I'm hoping someone will have the time to answer
them. Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default How to reference Cells AA and forward with CHAR (and a bonusquest

Babymech wrote...
I am in a position where I want to reference cells with 11 columns
in between them, i.e. if I first reference Cell A4 I then want to
reference Cell M4 and then Cell Y4 and so on. . . .

....

So every 12th column?

For simplicity's sake: =CHAR(65+12*B1)&1 where B1=3 returns lower
case "e" and 1 where I would want it to return AK and 1.


You want the return value to be the text string AK1?

=ADDRESS(1,1+B1*12,4)

Second question, somewhat related: what am I doing wrong with
=INDIRECT("CHAR("&65&")")

or for that matter

=INDIRECT("CHAR(65)")

I want both of these to resolve as CHAR(65) - i.e. capital "A" -
but instead I get #REF!


INDIRECT returns range references. It doesn't evaluate expressions.
It's argument must be a VALID range address. Neither A nor CHAR(65)
are valid range addresses, so INDIRECT correctly returns a #REF! error.
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
FIND 1 char in cell of any 3 char =True Nastech Excel Discussion (Misc queries) 5 April 26th 08 02:17 PM
I need an incentive form with id#,name, days, bonus, bonus, tot. lester[_2_] Excel Discussion (Misc queries) 0 April 7th 08 10:49 PM
linking cells to carry forward a hyperlink Beverley Setting up and Configuration of Excel 3 March 28th 07 01:40 PM
How to ignore the last char in some cells mmcap Excel Worksheet Functions 4 January 30th 07 03:07 AM
8500 cells with phone number(7 char.), wishing to add area code (10 char.) [email protected] Excel Discussion (Misc queries) 6 March 10th 06 05:13 PM


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