CronoExcell
New Member
- Joined
- Mar 31, 2019
- Messages
- 2
I am trying to crate an inventory tracking spreadsheet. I have made a button that moves entered information to another sheet.
The button takes the information in cells A6:F:6 individually and applies the information entered to a list of parts on another page.
The code I am using to do this is as follows:
Sub Button4_Click()
Dim Part as String, Description As String, Quantity As String, Location As String
Worksheets ("Data Entry") .Select
Part = Range ("A6")
Description = Range ("B6")
Needed = Range ("C6")
Quantity = Range ("D6")
Location = Range ("F6")
Vender = Range ("G6")
Worksheets ("Parts") .Select
If Worksheets ("Parts") .Range ("A1") .Offset (1,0) <> "" Then
Worksheets ("Parts") .Range ("A1") .End(xlDown) .Select
End If
ActiveCell.Offest (1,0) .Select
ActiveCell.Value = Part
The button takes the information in cells A6:F:6 individually and applies the information entered to a list of parts on another page.
The code I am using to do this is as follows:
Sub Button4_Click()
Dim Part as String, Description As String, Quantity As String, Location As String
Worksheets ("Data Entry") .Select
Part = Range ("A6")
Description = Range ("B6")
Needed = Range ("C6")
Quantity = Range ("D6")
Location = Range ("F6")
Vender = Range ("G6")
Worksheets ("Parts") .Select
If Worksheets ("Parts") .Range ("A1") .Offset (1,0) <> "" Then
Worksheets ("Parts") .Range ("A1") .End(xlDown) .Select
End If
ActiveCell.Offest (1,0) .Select
ActiveCell.Value = Part
ActiveCell.Offest (0,1) .Select
ActiveCell.Value = Needed
ActiveCell.Value = Needed
ActiveCell.Offest (0,1) .Select
ActiveCell.Value = Quantity
ActiveCell.Value = Quantity
ActiveCell.Offest (0,4) .Select
ActiveCell.Value = Description
ActiveCell.Value = Description
ActiveCell.Offest (0,-2) .Select
ActiveCell.Value = Location
ActiveCell.Value = Location
ActiveCell.Offest (0,3) .Select
ActiveCell.Value = Vender
Worksheets ("Data Entry") .Select
Worksheets ("Data Entry") .Range ("A2") .Select
End Sub
This works except I need it to not put the same part on the list Twice. I need it to scan the column A on the Parts page and see if the number in cell A6 on the Data entry page is already there if it is I would like a msgbox saying "Part Number already exists"
I am self taught so there may be something simple to fix this but the things I tried (data validation and the like) do not stop the button from putting the same entry into the list twice.
Thanks for your help.
Crono
ActiveCell.Value = Vender
Worksheets ("Data Entry") .Select
Worksheets ("Data Entry") .Range ("A2") .Select
End Sub
This works except I need it to not put the same part on the list Twice. I need it to scan the column A on the Parts page and see if the number in cell A6 on the Data entry page is already there if it is I would like a msgbox saying "Part Number already exists"
I am self taught so there may be something simple to fix this but the things I tried (data validation and the like) do not stop the button from putting the same entry into the list twice.
Thanks for your help.
Crono