Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default obtaining the collumn letter and row number separately

Hi:
Isthere a way to obtain the collumn letter (A) for example and hte row
number (2) as separate variables.
Any help apreciated.
Sean.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default obtaining the collumn letter and row number separately

Use the Row and Column properties of the range you are working with (with a
twist for the column letter). Assuming R is your range...

RowNumber = R.Row

ColumnNumber = R.Column

ColumnLetter =Split(R.Address(1, 0), "$")(0)

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
Hi:
Isthere a way to obtain the collumn letter (A) for example and hte row
number (2) as separate variables.
Any help apreciated.
Sean.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default obtaining the collumn letter and row number separately

is there a reference to the Split function.
or could someone explain the line:
ColumnLetter =Split(R.Address(1, 0), "$")(0)
cheers
Sean.
Cheers
Sean.
"Rick Rothstein" wrote in message
...
Use the Row and Column properties of the range you are working with (with
a twist for the column letter). Assuming R is your range...

RowNumber = R.Row

ColumnNumber = R.Column

ColumnLetter =Split(R.Address(1, 0), "$")(0)

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
Hi:
Isthere a way to obtain the collumn letter (A) for example and hte row
number (2) as separate variables.
Any help apreciated.
Sean.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default obtaining the collumn letter and row number separately

Since you posted in the programming newsgroup, I assumed you wanted VBA
code. Split is a VB function that breaks a delimited string of text into an
array of substrings (broken apart at the delimiter). You can see the help
files for Split by placing the caret (text cursor) in or next to the word
"split" and pressing F1. Most people will assign the output of the Split
function to an array and then use that array to pull out one of the
substring. Something like this...

Dim Fields() As String
Fields = Split(R.Address(1, 0), "$")
ColumnLetter = Fields(0)

My code bypassed assigning the output to an array and worked directly with
the array produced by the Split function in memory... that is what the
trailing (0) is for... it says to return the zero element of the array the
Split function directly.

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
is there a reference to the Split function.
or could someone explain the line:
ColumnLetter =Split(R.Address(1, 0), "$")(0)
cheers
Sean.
Cheers
Sean.
"Rick Rothstein" wrote in message
...
Use the Row and Column properties of the range you are working with (with
a twist for the column letter). Assuming R is your range...

RowNumber = R.Row

ColumnNumber = R.Column

ColumnLetter =Split(R.Address(1, 0), "$")(0)

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
Hi:
Isthere a way to obtain the collumn letter (A) for example and hte row
number (2) as separate variables.
Any help apreciated.
Sean.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default obtaining the collumn letter and row number separately

Cheers--it's a long time since I wrote any vb code!
Sean.
"Rick Rothstein" wrote in message
...
Since you posted in the programming newsgroup, I assumed you wanted VBA
code. Split is a VB function that breaks a delimited string of text into
an array of substrings (broken apart at the delimiter). You can see the
help files for Split by placing the caret (text cursor) in or next to the
word "split" and pressing F1. Most people will assign the output of the
Split function to an array and then use that array to pull out one of the
substring. Something like this...

Dim Fields() As String
Fields = Split(R.Address(1, 0), "$")
ColumnLetter = Fields(0)

My code bypassed assigning the output to an array and worked directly with
the array produced by the Split function in memory... that is what the
trailing (0) is for... it says to return the zero element of the array the
Split function directly.

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
is there a reference to the Split function.
or could someone explain the line:
ColumnLetter =Split(R.Address(1, 0), "$")(0)
cheers
Sean.
Cheers
Sean.
"Rick Rothstein" wrote in message
...
Use the Row and Column properties of the range you are working with
(with a twist for the column letter). Assuming R is your range...

RowNumber = R.Row

ColumnNumber = R.Column

ColumnLetter =Split(R.Address(1, 0), "$")(0)

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
Hi:
Isthere a way to obtain the collumn letter (A) for example and hte row
number (2) as separate variables.
Any help apreciated.
Sean.







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
Obtaining Unique Number From Data Validation List Matt Excel Discussion (Misc queries) 8 January 7th 09 03:50 AM
Adding a number to a letter of the alphabet to get a letter [email protected] Excel Worksheet Functions 5 May 21st 07 04:25 PM
counting if data from one collumn is present in another collumn Amelia Excel Worksheet Functions 1 February 8th 07 10:05 PM
change headers from letter to number/number to letter lazybee Excel Worksheet Functions 1 July 29th 05 11:08 PM
column header changed from letter to number, how return to letter Ron Excel Discussion (Misc queries) 2 May 9th 05 08:34 PM


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