i think i wanted exaclty what u have reffered
below...thanks soooooooo much.
let me try it!
-----Original Message-----
Hi Monika -
This macro asks how many RefEdits you want, then puts
that many onto the
form, each below the previous one. When the form is
hidden, it gets the
addresses of all of the RefEdits and puts them into a
message box.
The hard part was finding the ProgID for the RefEdit. I
was looking for
something like "Forms.RefEdit.1", but it's not a MSForms
control. A trip
to RegEdit show me that I needed "RefEdit.Ctrl". I wasn't
even sure this
would work, because those RefEdits can be feisty little
things.
Sub DrawRefEdits()
Dim i As Integer, i2 As Integer
Dim x As Single, y As Single
Dim ctlRef As Control
Dim msg As String
i2 = InputBox("How Many RefEdit Boxes?")
x = 12
y = 12
Load UserForm1
For i = 1 To i2
Set ctlRef = UserForm1.Controls.Add
("RefEdit.Ctrl")
With ctlRef
.Name = "Ref" & i
.Left = x
.Top = y
y = y + .Height
End With
Next
UserForm1.Show
For i = 1 To i2
msg = msg & UserForm1.Controls("Ref" & i).Value
& vbCrLf
Next
MsgBox msg
End Sub
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
http://PeltierTech.com/Excel/Charts/
_______
Monika wrote:
thanks all ...it works wonderfully.
I had another question related to the same. I want to
generate refedits on form based on a certain array
values..
like if my array has 5 i want 5 refedits to be added in
my
form..how can i do this..
thanks tremendously.
-----Original Message-----
Hi monika
MsgBox Range(RefEdit1).Cells(1).Value
--
XL2002
Regards
William
"monika" wrote in
message
. ..
| I want to get the value trapped through regedit.
| IF i select a cell $B$2 and I try to get the value
| throught:
| RefEdit1.Value
| i only get $B$2
|
| how can i get the actaul value and not the address??
|
| thanks
.
.