Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub CommandButton5_Click()
- With Worksheets(1).Range("f4:f1500") 'sets range to work in
- inpoot = UCase(InputBox("what filter would you like to add?")) 'pops up dialogue box asking for filter number and makes that number = inpoot
- Set c = .Find(inpoot, LookIn:=xlValues) 'makes c equal found cell containing "inpoot"[filternumber]
- If c Is Nothing Then 'if nothing is found it adds it to the bottom of the row and asks for shelf number and how many there are
- Range("f4").End(xlDown).Offset(1, 0).Select
- ActiveCell.Value = inpoot
- ActiveCell.Offset(0, 1) = InputBox("what shelf is it on")
- ActiveCell.Offset(0, 2) = InputBox("how man do you have")
- Me.CommandButton5.Activate
- SendKeys " " 'lazy way of looping
- ElseIf ActiveCell.Offset(0, 1) = Empty Then ' basically if c is something but cell next to it is empty it asks for the shelf
- ActiveCell.Offset(0, 1) = InputBox("what shelf is it on")
- Me.CommandButton5.Activate
- SendKeys " " 'lazy loop
- Else
- c.Offset(0, 2).Activate 'if c has a value and cell next to it[shelf] is populated it just asks how many filters there are
- ActiveCell.Value = InputBox("how many do you have") 'changes the qty column value to what ever you type in
- Me.CommandButton5.Activate
- SendKeys " " 'lazy loop
- End If
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement