lucky12341
Board Regular
- Joined
- Nov 4, 2005
- Messages
- 121
Ok guys here is the dilemna...I have a file I made for work since learning VBA (with beyond excellent help from this board), but I need a last bit of help on it if you guys can...
The code below takes some information I place in text boxes and slams it into a data file. As you can see it does a mini search to locate where to put it and places the data offset of of the location (its a mini warehouse file, they refused to use Access).
The trick I need this to also do is take 3 additional text boxes (that contain information of pulled pieces) and place them in the next available emtpy cell in that row. So they can do multiple pulls of one part without overwriting the information of previous pulls. Any help on this would be greatly apprecaited as my boss is riding me to get this done before monday deadline...thanks a million in advance
The code below takes some information I place in text boxes and slams it into a data file. As you can see it does a mini search to locate where to put it and places the data offset of of the location (its a mini warehouse file, they refused to use Access).
The trick I need this to also do is take 3 additional text boxes (that contain information of pulled pieces) and place them in the next available emtpy cell in that row. So they can do multiple pulls of one part without overwriting the information of previous pulls. Any help on this would be greatly apprecaited as my boss is riding me to get this done before monday deadline...thanks a million in advance
Code:
Private Sub cmdAmend_Click()
Dim strFind, FirstAddress As String
Dim rSearch As Range
Set rSearch = Sheet10.Range("a3", Range("a10425").End(xlUp))
strFind = Me.txtLocation.Value
With rSearch
Set c = .Find(strFind, LookIn:=xlValues)
If Not c Is Nothing Then
c.Select
With Me
c.Offset(0, 0) = c.Offset(0, 0)
c.Offset(0, 1).Value = .txtPO.Value
c.Offset(0, 2).Value = .txtItemNo.Value
c.Offset(0, 3).Value = .txtPN.Value
c.Offset(0, 4).Value = .txtPcMk.Value
c.Offset(0, 6).Value = .txtDescription.Value
c.Offset(0, 7).Value = .txtHIC.Value
c.Offset(0, 8).Value = .txtOQty.Value
c.Offset(0, 5).Value = .txtCQty.Value
.cmdAmend.Enabled = True
.cmdDelete.Enabled = True
.cmdAdd.Enabled = False
.cmdLocationFindAll.Enabled = True
.cmdPOFindAll.Enabled = False
.cmdItemNoFindAll.Enabled = False
.cmdPNFindAll.Enabled = False
.cmdPcMkFindAll.Enabled = False
.cmdDescriptionFindAll.Enabled = False
.cmdHICFindAll.Enabled = False
End With
End If
End With
End Sub