Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

refedit control cryptic returned value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tombates@city-net.com - 25 Jan 2006 17:46 GMT
I am using the refedit control on my userform.  That works fine.  I
would like to see something other than the cryptic value that it
passes.
For example the value that I get from using refedit is:
sheet1!$A$3:$D$5

I would like four values that are put into variables
A
3
D
5

How might I achieve this.
Mary
Jim Thomlinson - 25 Jan 2006 18:15 GMT
This gives you row and column of the top left and bottom right.

   Dim rng As Range
   
   Set rng = Range(RefEdit1.Text)
   
   MsgBox rng(1).Row
   MsgBox rng(1).Column
   MsgBox rng(rng.Count).Row
   MsgBox rng(rng.Count).Column

The only difference is it uses numbers instead of letters for the columns.
Generally the numbers are more useful, but you could convert that to letters
if that is what you require...
Signature

HTH...

Jim Thomlinson

> I am using the refedit control on my userform.  That works fine.  I
> would like to see something other than the cryptic value that it
[quoted text clipped - 10 lines]
> How might I achieve this.
> Mary
Tom Ogilvy - 25 Jan 2006 18:21 GMT
s = RefEdit.Value
set rng = Range(s)
set rng1 = rng(1)
set rng2 = rng(rng.count)
v1row = rng1.row
v2row = rng2.row
v1Col = rng1.column
v2Col = rng2.column
'
v1Letter = left(rng.Address(0,0),2+(rng1.column<=26))
v2Letter = Left(rng.Address(0,0),2+(rng2.Column<=26))

Signature

Regards,
Tom Ogilvy

> I am using the refedit control on my userform.  That works fine.  I
> would like to see something other than the cryptic value that it
[quoted text clipped - 10 lines]
> How might I achieve this.
> Mary
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.