Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default refedit controls and R1C1 notation

If a worksheet is set to use R1C1 notation, the entry in a refedit control
is in that notation when the user selects a cell. However the following
does not work:

dim selectedR as range
Set selectedR = Range(userform1.refedit1.text)

because of the R1C1 notation. The only solution I see is to check the
notation, set it to A1 notation, display the userform, get the information,
and then set the notation back to R1C1.

Is there a better way?

Bob



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default refedit controls and R1C1 notation

Hi Bob. How about..

Dim s As String, selectedR As Range
s = UserForm1.RefEdit1.Text
If Application.ReferenceStyle = xlR1C1 Then
Set selectedR = Range(Application.ConvertFormula(s, xlR1C1, xlA1))
Else
Set selectedR = Range(s)
End If

--
Tim Zych
http://www.higherdata.com
Workbook Compare - free and pro versions

"Robert Flanagan" wrote in message
...
If a worksheet is set to use R1C1 notation, the entry in a refedit control
is in that notation when the user selects a cell. However the following
does not work:

dim selectedR as range
Set selectedR = Range(userform1.refedit1.text)

because of the R1C1 notation. The only solution I see is to check the
notation, set it to A1 notation, display the userform, get the
information, and then set the notation back to R1C1.

Is there a better way?

Bob





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default refedit controls and R1C1 notation

Thanks Tim. That's a better solution than changing the setting.

Bob

"Tim Zych" <tzych@nospam at earthlink dot net wrote in message
...
Hi Bob. How about..

Dim s As String, selectedR As Range
s = UserForm1.RefEdit1.Text
If Application.ReferenceStyle = xlR1C1 Then
Set selectedR = Range(Application.ConvertFormula(s, xlR1C1, xlA1))
Else
Set selectedR = Range(s)
End If

--
Tim Zych
http://www.higherdata.com
Workbook Compare - free and pro versions

"Robert Flanagan" wrote in message
...
If a worksheet is set to use R1C1 notation, the entry in a refedit
control is in that notation when the user selects a cell. However the
following does not work:

dim selectedR as range
Set selectedR = Range(userform1.refedit1.text)

because of the R1C1 notation. The only solution I see is to check the
notation, set it to A1 notation, display the userform, get the
information, and then set the notation back to R1C1.

Is there a better way?

Bob







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
Sumproduct with A1 notation instead of R1C1 sgltaylor Excel Programming 2 September 12th 08 01:04 PM
R1C1 Notation in VBA Fred Holmes Excel Programming 1 October 21st 05 09:33 PM
Using Range with R1C1 notation in a macro J Excel Programming 1 January 23rd 04 04:46 AM
R1C1 Notation brym Excel Programming 4 July 27th 03 09:47 PM


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