Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Private Sub Worksheet_Activate()
  2.  
  3.  
  4. Dim msg As String
  5. Dim result As Integer
  6. Dim x As String
  7. msg = "Would you like to find the next available tag number?"
  8. result = MsgBox(msg, vbYesNo)
  9.  
  10. If result = vbYes Then
  11. x = Application.InputBox("Enter the part reference ")
  12.  
  13. Select Case x
  14.  
  15. Case x = "35C"
  16. NextFree = Range("A:A" & Rows.Count).Cells.SpecialCells(xlCellTypeBlanks).Row
  17. Range("A" & NextFree).Select
  18.  
  19. End Select
  20. Else
  21. Cancel = True
  22.  
  23. End If
  24.  
  25.  
  26.  
  27. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement