I am trying to make a vba for multiple people to enter data to update a master file.
The input file will start with a unique identifier (part number) in first column. The number of rows could be 1 or 100
Then based on the first column it will pull the other columns (about 10 but more could be added) in the master file. --- having trouble figuring out the loop to keep looking at offsets
There will be empty data in the columns i need it to ignore them.
Thanks a bunch updating this master file for our whole department has been a pain and is due for us to mess up the file.
My start to the vba...
Sub inputdata()
Dim Temptext As String
Dim Tempvalue As String
Worksheets("PFEP_Master").Select
Range("A2").Select
Worksheets("input").Select
Range("A2").Select
Temptext = ActiveCell.Value
Tempvalue = ActiveCell.Offset(0, 1).Value
Worksheets("PFEP_Master").Select
Do While ActiveCell.Value <> ""
Do While ActiveCell.Value <> ""
If ActiveCell.Value = Temptext Then
ActiveCell.Offset(0, 1).Value = Tempvalue
End If
ActiveCell.Offset(1, 0).Select
Loop
Range("A2").Select
Worksheets("input").Select
If ActiveCell.Offset(1, 0).Value = "" Then
Range("A1").Select
MsgBox "Data inputed", vbExclamation
Exit Sub
Else
ActiveCell.Offset(1, 0).Select
End If
Temptext = ActiveCell.Value
Tempvalue = ActiveCell.Offset(0, 2).Value
Worksheets("PFEP_Master").Select
Loop
End Sub
The input file will start with a unique identifier (part number) in first column. The number of rows could be 1 or 100
Then based on the first column it will pull the other columns (about 10 but more could be added) in the master file. --- having trouble figuring out the loop to keep looking at offsets
There will be empty data in the columns i need it to ignore them.
Thanks a bunch updating this master file for our whole department has been a pain and is due for us to mess up the file.
My start to the vba...
Sub inputdata()
Dim Temptext As String
Dim Tempvalue As String
Worksheets("PFEP_Master").Select
Range("A2").Select
Worksheets("input").Select
Range("A2").Select
Temptext = ActiveCell.Value
Tempvalue = ActiveCell.Offset(0, 1).Value
Worksheets("PFEP_Master").Select
Do While ActiveCell.Value <> ""
Do While ActiveCell.Value <> ""
If ActiveCell.Value = Temptext Then
ActiveCell.Offset(0, 1).Value = Tempvalue
End If
ActiveCell.Offset(1, 0).Select
Loop
Range("A2").Select
Worksheets("input").Select
If ActiveCell.Offset(1, 0).Value = "" Then
Range("A1").Select
MsgBox "Data inputed", vbExclamation
Exit Sub
Else
ActiveCell.Offset(1, 0).Select
End If
Temptext = ActiveCell.Value
Tempvalue = ActiveCell.Offset(0, 2).Value
Worksheets("PFEP_Master").Select
Loop
End Sub