Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to express a cell address into numeric for array use

Im trying to to convert a cell address (ie E4) into some numeric form so I can enter it into a 2d array
Im not sure how to do this especially when there is a number and letter.

Also related is that im trying to clear a cell if it doesnt meet some criteria. It keeps looping for several iterations

Dim rng As Range
Set rng = Target.Cells

With rng.Select

'I tried selection.clearcontents but loops
'also tried Cells(i + 3, Chr(68 + j)).Select where i and j are used in for loops

End With

Thanks
Mike



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to express a cell address into numeric for array use

Susan,

Dim str

str = "E4"
Debug.Print Range(str).Row
Debug.Print Range(str).Column
str = "AI4"
Debug.Print Range(str).Row
Debug.Print Range(str).Column

By this, I am trying to show that if you have a string, I use str, containg
a cell address string, you can use the Range object row and column
properties to get a number. This also takes care of a string like AI1, as my
example shows.

The Cells can take a column letter or number, so there is no need for the
Chr. Just use
Cells(i + 3, j +4).Select
although of course you never need to do a Select ;-)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Susan Hayes" wrote in message
...
Im trying to to convert a cell address (ie E4) into some numeric form so I

can enter it into a 2d array
Im not sure how to do this especially when there is a number and letter.

Also related is that im trying to clear a cell if it doesnt meet some

criteria. It keeps looping for several iterations

Dim rng As Range
Set rng = Target.Cells

With rng.Select

'I tried selection.clearcontents but loops
'also tried Cells(i + 3, Chr(68 + j)).Select where i and j are

used in for loops

End With

Thanks
Mike





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
Clicking on cell with email address opens Outlook Express Exceluser2400 Excel Discussion (Misc queries) 2 June 25th 09 08:19 PM
Separating Alpha from Numeric in Address Cell in Excel DBUTTER69 Excel Discussion (Misc queries) 1 April 3rd 09 02:04 PM
Find a value in an array and return cell address PJFry Excel Worksheet Functions 12 January 28th 09 02:23 PM
How do I access Outlook Express email address book using Excel Clarrie s4 Excel Discussion (Misc queries) 1 July 14th 07 03:35 AM
How do I import Office address book to Outlook Express address bo. snnorp Excel Discussion (Misc queries) 2 February 22nd 05 11:47 AM


All times are GMT +1. The time now is 03:56 AM.

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"