Right now I have a userform that opens as soon as the workbook is opened. It prompts for the user to put their name then it dumps it into a cell in the spreadsheet. If the contents of the cell are removed the userform reappears. This works great on pcs but it doesn't work on macs! Here is what I have:
Private Sub CommandButton1_Click()
If TextBox1.Value = "" Then
MsgBox "Please enter your name in the text field"
Me.TextBox1.SetFocus
Else
Range("C2").Value = UserForm1.TextBox1.Text
UserForm1.Hide
End If
End Sub
Private Sub UserForm_QueryClose _
(Cancel As Integer, CloseMode As Integer)
' Prevents use of the Close button
If CloseMode = vbFormControlMenu Then
MsgBox "Please enter your name in the text field"
Cancel = True
End If
End Sub
Again this runs when the workbook is opened:
Private Sub Workbook_Open()
UserForm1.TextBox1.SetFocus
UserForm1.Show
End Sub
When the cell is emptied it reappears:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$C$2" Then Exit Sub
If Target.Value = "" Then
UserForm1.Show
End If
End Sub
This works great with pcs but how do I get it to work with macs?! Any help will be appreciated.
Private Sub CommandButton1_Click()
If TextBox1.Value = "" Then
MsgBox "Please enter your name in the text field"
Me.TextBox1.SetFocus
Else
Range("C2").Value = UserForm1.TextBox1.Text
UserForm1.Hide
End If
End Sub
Private Sub UserForm_QueryClose _
(Cancel As Integer, CloseMode As Integer)
' Prevents use of the Close button
If CloseMode = vbFormControlMenu Then
MsgBox "Please enter your name in the text field"
Cancel = True
End If
End Sub
Again this runs when the workbook is opened:
Private Sub Workbook_Open()
UserForm1.TextBox1.SetFocus
UserForm1.Show
End Sub
When the cell is emptied it reappears:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$C$2" Then Exit Sub
If Target.Value = "" Then
UserForm1.Show
End If
End Sub
This works great with pcs but how do I get it to work with macs?! Any help will be appreciated.