artsandcraftshome
Technical User
I would like to return to my sheet after displaying a user form, but it just returns me to the VBA page (after flashing the sheet but not retaining it). Any ideas why this is happening?
Thanks for any help you might offer..I'm stumped. John
Here's my code:
Sub eMD()
Sheets("eMD"
.Select
AVGDIM = InputBox("Enter the average Field Size on skin (cm)"
Range("C7"
.Select
Selection.FormulaR1C1 = AVGDIM
PRESCD = InputBox("Enter the Prescription Depth(cm)"
Range("C8"
.Select
Selection.FormulaR1C1 = PRESCD
'Set the variable PDEPTH to the prescription field depth
PDEPTH = Range("I7"
.Value
SKINFS = Range("I8"
.Value
'Display the PDD table sheet
Sheets("PDD TABLES"
.Select
'Select the row for the prescription depth and the column where this FS PDD starts
Cells(SKINFS, PDEPTH).Select
'Display a form that will retrieve the value of PDD from the PDD table
frmeMD.Show
'Set the sheet back to the eMD sheet
Sheets("eMD"
.Select
Range("C10"
.Select
End Sub
AND HERE'S THE CODE FOR THE USER FORM:
Private Sub CommandButton1_Click()
Dim SelRangeMD As Range
Dim AddrMD As String
'Get the address from the RefEdit control
AddrMD = RefEdit1.Value
'Set the SelRange object to the range specified in the RefEdit control
Set SelRangeMD = Range(AddrMD)
MDCHOICE = SelRangeMD.Value
ThisWorkbook.Worksheets("eMD"
.Range("C10"
.Value = CInt(MDCHOICE)
'unload the UserForm
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Thanks for any help you might offer..I'm stumped. John
Here's my code:
Sub eMD()
Sheets("eMD"
AVGDIM = InputBox("Enter the average Field Size on skin (cm)"
Range("C7"
Selection.FormulaR1C1 = AVGDIM
PRESCD = InputBox("Enter the Prescription Depth(cm)"
Range("C8"
Selection.FormulaR1C1 = PRESCD
'Set the variable PDEPTH to the prescription field depth
PDEPTH = Range("I7"
SKINFS = Range("I8"
'Display the PDD table sheet
Sheets("PDD TABLES"
'Select the row for the prescription depth and the column where this FS PDD starts
Cells(SKINFS, PDEPTH).Select
'Display a form that will retrieve the value of PDD from the PDD table
frmeMD.Show
'Set the sheet back to the eMD sheet
Sheets("eMD"
Range("C10"
End Sub
AND HERE'S THE CODE FOR THE USER FORM:
Private Sub CommandButton1_Click()
Dim SelRangeMD As Range
Dim AddrMD As String
'Get the address from the RefEdit control
AddrMD = RefEdit1.Value
'Set the SelRange object to the range specified in the RefEdit control
Set SelRangeMD = Range(AddrMD)
MDCHOICE = SelRangeMD.Value
ThisWorkbook.Worksheets("eMD"
'unload the UserForm
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub