VBA for Dialog Box

G

Gary

I receive a error message code 9 "Subscript Out of Range"
when the VBA code for retreiving information from an
editbox in a dialog box. All editboxes in my dialog box
have a name. For example: My dialog box is in a dialog
sheet named "BoMSetUp", Editbox is named "RONum",
Worksheet is named "BoMform". I want to take the entered
text of the "RONum" editbox and insert that text into
cell "C4" in my worksheet "BoM form". The code
reads "Sheets("BoM form").Range("C4").Value = DialogSheets
("BoMSetUp").EditBoxes("RONum").text. When running the
macro i receive the error message code 9. Can anyone help
me?

Thanks,
Gary
 
T

Tom Ogilvy

Sub AA_Getvalue()
Sheets("BoM form").Range("C4").Value = _
DialogSheets("BoMSetUp").EditBoxes("RONum").Text
End Sub

worked fine for me (xl2000) whether I ran if from a general module with the
no dialog showing or whether I attached the code to a button on the
dialogsheet and ran it by clicking the button.

Perhaps you have a miss spelling or one of the names contains a space on the
end or something similar.

Regards
Tom Ogilvy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top