Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. Sub ContactInfo()
  2. Application.ScreenUpdating = False
  3. Application.DisplayAlerts = False
  4.  
  5. Dim ArrayRange As Variant
  6. Dim ActCell As Variant
  7.  
  8. Set ActCell = ActiveCell
  9. OwnerName = ActiveCell.Value
  10.  
  11. If IsEmpty(ActiveCell) = True Or IsNumeric(ActiveCell) = True Then
  12.  
  13. MsgBox "Please select Owner Name"
  14.  
  15. Else
  16.  
  17. Sheets("Combined").Select
  18. ArrayRange = Sheets("Combined").Range(Range("R1"), Range("R1").SpecialCells(xlLastCell))
  19. Sheets("Pivot").Select
  20.  
  21. Lastname = Application.WorksheetFunction.VLookup(ActCell, ArrayRange, 3, False)
  22. Firstname = Application.WorksheetFunction.VLookup(ActCell, ArrayRange, 2, False)
  23. Phone = Application.WorksheetFunction.VLookup(ActCell, ArrayRange, 9, False)
  24. Address = Application.WorksheetFunction.VLookup(ActCell, ArrayRange, 4, False)
  25.  
  26. MsgBox "Owner: " & OwnerName & vbCrLf & vbCrLf & "Contact: " & Lastname & ", " & Firstname & vbCrLf & vbCrLf & "Phone: " & Phone & vbCrLf & vbCrLf & "Address: " & Address
  27.  
  28. Application.ScreenUpdating = True
  29.  
  30. End If
  31.  
  32. End Sub
  33.  
  34. Sub PropertyInfo()
  35. Application.ScreenUpdating = False
  36. Application.DisplayAlerts = False
  37.  
  38. Dim ArrayRange As Variant
  39. Dim ActCell As Variant
  40.  
  41. Set ActCell = ActiveCell
  42. PropertyName = ActiveCell.Value
  43.  
  44. If IsEmpty(ActiveCell) = True Or IsNumeric(ActiveCell) = True Then
  45.  
  46. MsgBox "Please select Property Name"
  47.  
  48. Else
  49.  
  50. Sheets("Combined").Select
  51. ArrayRange = Sheets("Combined").Range(Range("F1"), Range("F1").SpecialCells(xlLastCell))
  52. Sheets("Pivot").Select
  53.  
  54. Maturity = Application.WorksheetFunction.VLookup(ActCell, ArrayRange, 38, False)
  55. Lender = Application.WorksheetFunction.VLookup(ActCell, ArrayRange, 43, False)
  56. Originator = Application.WorksheetFunction.VLookup(ActCell, ArrayRange, 44, False)
  57. Address = Application.WorksheetFunction.VLookup(ActCell, ArrayRange, 2, False)
  58.  
  59. MsgBox "Property Name: " & PropertyName & vbCrLf & vbCrLf & "Loan Maturity: " & Maturity & vbCrLf & vbCrLf & "Lender: " & Lender & vbCrLf & vbCrLf & "Originator: " & Originator & vbCrLf & vbCrLf & "Property Address: " & Address & vbCrLf & vbCrLf & "Note: If dates are blank, the database doesnt have the info."
  60.  
  61. Application.ScreenUpdating = True
  62.  
  63. End If
  64.  
  65. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement