Userform issue...

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

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
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
The following will put the value of your textbox (rename as appropriate) in the next available column at the end of your data:

Code:
c.Offset(0, (Range("IV" & c.Row).End(xlToLeft).Column + 1) - c.Column) = .YourNewTextBox.Value
 
Upvote 0

Forum statistics

Threads
1,214,775
Messages
6,121,498
Members
449,034
Latest member
Raygers

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top