Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple, but I don't see it
This is probably so easy, but I don't see what is wrong. Everything works
great except for the line were i put **** isn't showing up in the database. It leaves it blank. The combo box works great. Help! Private Sub cmdAddWaste_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Database") 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row 'check for a date If Trim(Me.txtD.Value) = "" Then Me.txtDate.SetFocus MsgBox "Please enter a Date" Exit Sub End If 'copy the data to the database ws.Cells(iRow, 1).Value = "=R[-1]C+1" ws.Cells(iRow, 2).Value = Me.txtD.Value ws.Cells(iRow, 3).Value = Me.cboProduceItem.Value *********** ws.Cells(iRow, 4).Value = "0" ws.Cells(iRow, 5).Value = "0" ws.Cells(iRow, 6).Value = Me.txtBxsWaste.Value ws.Cells(iRow, 7).Value = Me.txtWeight.Value ws.Cells(iRow, 8).Value = Me.txtPrice.Value ws.Cells(iRow, 9).Value = "None" ws.Cells(iRow, 10).Value = "Waste" 'select a cold storage If Me.OptionButton3.Value Then ws.Cells(iRow, 11).Value = Me.OptionButton3.Caption Else ws.Cells(iRow, 11).Value = Me.OptionButton4.Caption End If 'clear the data Me.cboProduceItem.Value = "" Me.txtBxsWaste.Value = "" Me.txtD.Value = Format(Date, "Medium Date") Me.txtWeight.Value = "" Me.cboProduceItem.SetFocus Me.txtPrice.Value = "" End Sub -- Though daily learning, I LOVE EXCEL! Jennifer |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple, but I don't see it
Did you try using the .Text property?
"Jennifer" wrote: This is probably so easy, but I don't see what is wrong. Everything works great except for the line were i put **** isn't showing up in the database. It leaves it blank. The combo box works great. Help! Private Sub cmdAddWaste_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Database") 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row 'check for a date If Trim(Me.txtD.Value) = "" Then Me.txtDate.SetFocus MsgBox "Please enter a Date" Exit Sub End If 'copy the data to the database ws.Cells(iRow, 1).Value = "=R[-1]C+1" ws.Cells(iRow, 2).Value = Me.txtD.Value ws.Cells(iRow, 3).Value = Me.cboProduceItem.Value *********** ws.Cells(iRow, 4).Value = "0" ws.Cells(iRow, 5).Value = "0" ws.Cells(iRow, 6).Value = Me.txtBxsWaste.Value ws.Cells(iRow, 7).Value = Me.txtWeight.Value ws.Cells(iRow, 8).Value = Me.txtPrice.Value ws.Cells(iRow, 9).Value = "None" ws.Cells(iRow, 10).Value = "Waste" 'select a cold storage If Me.OptionButton3.Value Then ws.Cells(iRow, 11).Value = Me.OptionButton3.Caption Else ws.Cells(iRow, 11).Value = Me.OptionButton4.Caption End If 'clear the data Me.cboProduceItem.Value = "" Me.txtBxsWaste.Value = "" Me.txtD.Value = Format(Date, "Medium Date") Me.txtWeight.Value = "" Me.cboProduceItem.SetFocus Me.txtPrice.Value = "" End Sub -- Though daily learning, I LOVE EXCEL! Jennifer |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
Make it more simple or intuitive to do simple things | Charts and Charting in Excel | |||
simple question, hopefully a simple answer! | Excel Programming |