我想到了。这是我的代码的工作结果。
Sub EnterContact()
Dim lastrow As Long, strCust As String, strAddress As String
Dim strTown As String, strZip As String, strPhone As String
Dim strFax As String, strEmail As String, strContact As String
Dim strPrior As String, strOrg As String, strProj As String
With Sheets("Oregon")
lastrow = .Range("A" & .Rows.Count).End(xlUp).Row + 1
strCust = InputBox("Enter Customer")
strAddress = InputBox("Enter Address")
strTown = InputBox("Enter Town")
strZip = InputBox("Enter Zip Code")
strPhone = InputBox("Enter Phone Number")
strFax = InputBox("Enter Fax Number")
strEmail = InputBox("Enter Email Address")
strContact = InputBox("Enter Contact Name")
strPrior = InputBox("Enter Priority Level")
strOrg = InputBox("Enter Organization")
strProj = InputBox("Enter Projected Dollar Amount")
Range("A" & lastrow).Value = strCust
Range("B" & lastrow).Value = strAddress
Range("C" & lastrow).Value = strTown
Range("D" & lastrow).Value = strZip
Range("E" & lastrow).Value = strPhone
Range("F" & lastrow).Value = strFax
Range("G" & lastrow).Value = strEmail
Range("H" & lastrow).Value = strContact
Range("I" & lastrow).Value = strPrior
Range("J" & lastrow).Value = strOrg
Range("K" & lastrow).Value = strProj
Dim LRow As Long
'Find last row in Column A with content
LRow = Cells(Rows.Count, 1).End(xlUp).Offset(0, 0).Row
Rows("5:" & LRow).Sort Key1:=.Range("C3"), _
Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End With
End Sub