compile error

red95

Board Regular
Joined
Jan 4, 2009
Messages
141
compile error method or data member not found

error is at If Trim(Me.txtaddressrouter.Value)

win 7 excel 2007



Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("sheet1")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'check for a part number
If Trim(Me.txtaddressrouter.Value) = "" Then
Me.txtaddressrouter.SetFocus
MsgBox "Please enter carrier name"""
Exit Sub
End If

'copy the data to the database
ws.Cells(iRow, 1).Value = Me.txtstart.Value
ws.Cells(iRow, 2).Value = Me.Txtend.Value
ws.Cells(iRow, 3).Value = Me.txtpub.Value




'clear the data
Me.txtstart.Value = ""
Me.Txtend.Value = ""
Me.txtpub.Value = ""



Me.txtaddressrouter.SetFocus

End Sub

Private Sub cmdclose_Click()
Unload Me

End Sub

Private Sub UserForm_Click()

End Sub
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,224,585
Messages
6,179,706
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top