CharlesM
Chemical
- Jan 2, 2001
- 1
How do I use edit boxes in a dialog window to return a text string which I can then place in the cell of a spreadsheet?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Private Sub CommandButton1_Click()
Dim MySheet As Worksheet
Dim sString As String
Set MySheet = Sheets("Sheet1")
sString = TextBox1.Text
MySheet.Range("A1").FormulaR1C1 = sString
Unload Me
End Sub
Sub Macro1()
UserForm1.Show
End Sub
cells(rowindex,colindex).value=TextBox1.text
Private Sub cb1_Click()
'
If tb1 = "pwd" Then ' admin password is "pwd"
ActiveSheet.Unprotect ("palusa") ' startup sheet protect. passwrd
' is "palusa"
Sheets("Sheet2").Select
Range("A1").Select
'
'... continue with your code
'
Unload Me
Else
MsgBox "Invalid Password", vbOKOnly, "Check!"
tb1 = ""
End If
End Sub
Private Sub cb2_Click()
ActiveSheet.Select
Range("A1").Select
Unload Me
End Sub