dmatthews778
New Member
- Joined
- Aug 10, 2011
- Messages
- 2
Hi everyone,
I was wondering if anyone else has had any trouble using macros that work fine on a PC on a mac and it not working? I have been smashing my face into my keyboard trying to figure out why this won't work on excel '11 on my mac but it works fine for excel on my PC... I could just be retarded because I don't really know what I'm doing... if something is wrong with this code, call me out... hopefully it's just user error and not a system issue :\
Thanks
Btw, this is the code i'm using for an "add location" button and a "cancel" button in a user entry pop-up box:
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("PROPERTY & LIABILITY LOC.")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(x1Up).Offset(1, 0).Row
'check for a Street Address
If Trim(Me.txtStreetAddress.Value) = "" Then
Me.txtStreetAddress.SetFocus
MsgBox "Please enter a Street Address"
End If
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.txtPart.Value
ws.Cells(iRow, 2).Value = Me.txtCityState.Value
ws.Cells(iRow, 3).Value = Me.txtZIP.Value
ws.Cells(iRow, 4).Value = Me.txtCOVERAGES.Value
ws.Cells(iRow, 5).Value = Me.txtOCCUPANCY.Value
ws.Cells(iRow, 6).Value = Me.txtEXPOSURE.Value
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
I was wondering if anyone else has had any trouble using macros that work fine on a PC on a mac and it not working? I have been smashing my face into my keyboard trying to figure out why this won't work on excel '11 on my mac but it works fine for excel on my PC... I could just be retarded because I don't really know what I'm doing... if something is wrong with this code, call me out... hopefully it's just user error and not a system issue :\
Thanks
Btw, this is the code i'm using for an "add location" button and a "cancel" button in a user entry pop-up box:
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("PROPERTY & LIABILITY LOC.")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(x1Up).Offset(1, 0).Row
'check for a Street Address
If Trim(Me.txtStreetAddress.Value) = "" Then
Me.txtStreetAddress.SetFocus
MsgBox "Please enter a Street Address"
End If
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.txtPart.Value
ws.Cells(iRow, 2).Value = Me.txtCityState.Value
ws.Cells(iRow, 3).Value = Me.txtZIP.Value
ws.Cells(iRow, 4).Value = Me.txtCOVERAGES.Value
ws.Cells(iRow, 5).Value = Me.txtOCCUPANCY.Value
ws.Cells(iRow, 6).Value = Me.txtEXPOSURE.Value
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub