John,
Dimension a string as a public variable at the top of a codemodule:
Option Explicit
Public myStr As String
Sub TryNow()
Load UserForm1
UserForm1.Show
MsgBox myStr
Range(myStr).Select
End Sub
Put a RefEdit box on your userform - which is the best way to select a
range, and then use something like this with a commandbutton:
Private Sub CommandButton1_Click()
myStr = UserForm1.RefEdit1.Text
UserForm1.Hide
End Sub
HTH,
Bernie
MS Excel MVP
John Kauffman said:
Using VBA, I want to collect a range from the user with a UserForm, and
then pass the range string to a subroutine in a module. I can pass numbers
in this fashion, but I am unsuccessful passing strings. Any suggestions?