Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone help identify why this is not working correctly. Following is the
full code from the form. Myself and another member have worked on this but can not resolve the problem. This code is used for a 2 page form that takes information from the sheet to create the combo Boxes (.....List). What it is not doing, is entering the data from the text box (.....Date) back into the sheet (Called Dates - Invoice goes in col B and Visit Col C) - against the entry that has been selected from the combo box (range of customer names from col A). ---------------------------------- Option Explicit 'This searches for the seletion in the comboBox 'Then goes to the Column to input the date entered Sub SaveVisit_Click() Dim foundCell As Range With Worksheets(1).Range("A1:A65536") Set foundCell = .Find(What:=VisitList.Value, lookAt:=xlWhole, _ LookIn:=xlValues, SearchOrder:=xlRows, _ MatchCase:=True, MatchByte:=True) If Not foundCell Is Nothing Then foundCell.Offset(0, 2).Value = VisitDate.Value End If End With VisitList.Value = "" VisitDate.Value = "" End Sub 'This way your company list stays in its 'current range & only the dates change ------------------------------------------------- Private Sub SaveInvoice_Click() Dim foundCell As Range With Worksheets(1).Range("a1:a65536") Set foundCell = .Find(What:=InvoiceList.Value, lookAt:=xlWhole, _ LookIn:=xlValues, SearchOrder:=xlRows, _ MatchCase:=True, MatchByte:=True) If Not foundCell Is Nothing Then foundCell.Offset(0, 1).Value = InvoiceDate.Value End If End With InvoiceList.Value = "" InvoiceDate.Value = "" End Sub -------------------------------------------------- Private Sub CloseVisit_Click() Unload Me End Sub --------------------------------------------------- Private Sub CloseInvoice_Click() Unload Me End Sub --------------------------------------------------- 'This will use your Sheets 'Data to populate the ComboBox 'Your ComboBox will then be able to grow as your list grows Private Sub UserForm_Initialize() VisitList.RowSource = "Dates!A2:A300" InvoiceList.RowSource = "Dates!A2:A300" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro - Code Missing | Excel Discussion (Misc queries) | |||
Missing VBA Code in Excel 2007 | Excel Programming | |||
Missing code | Excel Programming | |||
Missing something in my code... | Excel Programming | |||
VB code gone missing | Excel Programming |