ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,226
- Office Version
- 2007
- Platform
- Windows
Afternoon,
I have a userform which has textboxes etc where i add values then these are transfered to the worksheet.
I have two ComboBoxes on the form.
1 x NameForDateEntryBox has customers names of which i select from the list.
1 x PostageIssueBox has a few words of which i also select from,these are populated from Table34
I have a command button for which i need to apply code to.
The name of the command button is PostageIssueButton
This is what the command button should do.
Look at customers name from NameForDateEntryBox
Look at word from PostageIssueBox
Worksheet is called POSTAGE
Customers name will be in column B
Once customer has been found enter the word taken from PostageIssueBox & put it in column G for the customer in question.
If its any use & to save you time i already have something that pretty much does this BUT you will need to add the piece of code for looking at the value in PostageIssueBox
I have a userform which has textboxes etc where i add values then these are transfered to the worksheet.
I have two ComboBoxes on the form.
1 x NameForDateEntryBox has customers names of which i select from the list.
1 x PostageIssueBox has a few words of which i also select from,these are populated from Table34
I have a command button for which i need to apply code to.
The name of the command button is PostageIssueButton
This is what the command button should do.
Look at customers name from NameForDateEntryBox
Look at word from PostageIssueBox
Worksheet is called POSTAGE
Customers name will be in column B
Once customer has been found enter the word taken from PostageIssueBox & put it in column G for the customer in question.
If its any use & to save you time i already have something that pretty much does this BUT you will need to add the piece of code for looking at the value in PostageIssueBox
Rich (BB code):
Dim sh As Worksheet
Dim b As Range
Dim wName As String, res As Variant
If NameForDateEntryBox.ListIndex = -1 Then
MsgBox "Please Select A Customer Before The Date Transfer Button", vbCritical, "Delivery Parcel Date Transfer"
Exit Sub
End If
If TextBox7.Value = "" Or Not IsDate(TextBox7.Value) Then
MsgBox "Please Enter A Valid Date", vbCritical, "Delivery Parcel Date Transfer"
TextBox7 = ""
TextBox7.SetFocus
Exit Sub
End If
wName = NameForDateEntryBox.List(NameForDateEntryBox.ListIndex)
Set sh = Sheets("POSTAGE")
Set b = sh.Columns("B").Find(wName, LookIn:=xlValues, LookAt:=xlWhole)
If Not b Is Nothing Then
If sh.Cells(b.Row, "G") <> "" And UCase(sh.Cells(b.Row, "G")) <> "POSTED" Then
MsgBox "DATE HAS BEEN ENTERED ALREADY !" & vbCrLf & "CLICK OK TO GO CHECK IT OUT", vbCritical, "Delivery Parcel Date Transfer"
TextBox7 = ""
Unload PostageTransferSheet
Cells(b.Row, "G").Select
Else
sh.Cells(b.Row, "G").Value = CDate(TextBox7.Value)
sh.Cells(b.Row, "G").Interior.Color = vbYellow
MsgBox "DATE APPLIED TO WORKSHEET FOR " & NameForDateEntryBox.Value, vbInformation, "DELIVERY PARCEL DATE TRANSFER MESSAGE"
NameForDateEntryBox.Clear
UserForm_Initialize
End If
End If
NameForDateEntryBox = ""
TextBox7 = ""
TextBox7.Value = Format(CDbl(Date), "dd/mm/yyyy")
End Sub