LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 262
Default Problem getting results of RefEdit into a range

Thanks to Dave and all who provided answers to this question.
Keith

"Dave Peterson" wrote:

You could try something like this, too:

Option Explicit
Private Sub CommandButton1_Click()
Dim myRng As Range

Set myRng = Nothing
On Error Resume Next
Set myRng = Application.Range(Me.RefEdit1.Value)
On Error GoTo 0

If myRng Is Nothing Then
MsgBox "not a valid range"
Else
MsgBox myRng.Address(external:=True)
End If

End Sub

keith wrote:

Hello,

The worksheets property under €œhelp€ describes ranges by using the following
example,

MsgBox Worksheets("Sheet1").Range("A1").Value

In my code, I am using two forms of it. They are€¦

Worksheets(1).Range("c5:c10").Cells(1, 1).Formula = "=rand()"

And

Debug.Print Examine_a_Range (Worksheets("Sheet1").Range("B3:D21"))
The function €œExamine_a_Range€ has opening line of €¦

Function Examine_a_Range(Rng0 As Range) As Variant

Some code here..

End function

Now that I€„˘ve learned how to obtain the cell range from the RefEdit control,
I see the form of a cell range from RefEdit is€¦

Sheet1!$E$9:$F$11

If I want to use the value from the RefEdit control in my code, do I have to
go through some text editing work to split up the value from RefEdit, or is
there a better way to assign the value to a Range and make it all work?

Thank you,

Keith


--

Dave Peterson



 
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
Refedit very serious/urgent problem avi Excel Programming 3 March 25th 09 09:21 AM
Problem with RefEdit Control in VBA Dileep T M Excel Programming 1 September 17th 08 04:37 AM
Strange RefEdit Problem Pflugs Excel Programming 12 July 10th 07 01:12 PM
Refedit copy paste problem? T.c.Goosen1977[_51_] Excel Programming 0 July 10th 06 09:55 AM
RefEdit in Class Module Problem Mark Driscol[_2_] Excel Programming 6 June 27th 06 04:29 PM


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