Refer to first cell in range
In general, you can use the Cells method of the range to get to any cell
within the range. In particular, the first cell in the range can be referred
this way...
Debug.Print Range(RefEdit).Cells(1, 1).Value
As an aside, this can be shortened this way if desired...
Debug.Print Range(RefEdit)(1, 1).Value
which, because you are interested in only the first column, can be shortened
even further like this...
Debug.Print Range(RefEdit)(1).Value
--
Rick (MVP - Excel)
"art" wrote in message
...
The refedit is where the user enter a range. I need to refer to the first
cell in the range. How can I refer to that?
"JLGWhiz" wrote:
This will take care of the multicolumn selection. Put it
in the worksheet code module.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Columns.Count 1 Then
Selection.Columns(1).Select
End If
End Sub
I don't understand your first question. You need to rephrase it to
specify what the image is, Sheet, Shape, Picture, Selected Range?
"art" wrote:
Hello:
I have a userform with a refedit. I need to refer to the first cell
(top) in
the rnage how can I refer to it?
Also How can I retrict the user to select only 1 column at a time,
meaning
he can select a range from column C from row 1 to row 10000... but he
cannot
also select C1 to D5?
Thanks
|