Date Type Mismatch

  • Thread starter Thread starter johncassell
  • Start date Start date
J

johncassell

Hello, I am getting very annoyed with this poxy textbox I am doing
please can someone help me out!!!

On opening my userform, my textbox (date1.text) populates with the dat
which is in column A of the active row.

On closing my userform, my textbox puts whatever is in the date1.tex
box into the cell in column A of the same active row.

My problem is that I open the sheet and the box says "20-Jul-05",
then hit my update command button and the form closes. When I go t
open the userform using the same row VB says "Run-time error '13': Typ
Mismatch".


My only code is:
Private Sub UserForm_Initialize()
Date1.Text = ActiveCell.Offset(0, -ActiveCell.Column + 1)
-----------------------------------------------------------------------------------

Private Sub EnterIssue_click()
ActiveCell.Offset(0, -ActiveCell.Column + 1) = Date1.Text

Can anybody help with this please, I would be really grateful!!
 
This is the whole version of my code (I assumed the bit I posted was th
only bits which needed inspection). Thanks for the reply

Private Sub UserForm_Initialize()
Date1.Text = ActiveCell.Offset(0, -ActiveCell.Column + 1)
JobNumber1.Text = ActiveCell.Offset(0, -ActiveCell.Column + 2)
BinNumber1.Text = ActiveCell.Offset(0, -ActiveCell.Column + 3)
Description1 = ActiveCell.Offset(0, -ActiveCell.Column + 4)
NumberIssued1.Text = ActiveCell.Offset(0, -ActiveCell.Column + 5)
TotalCost1 = "£" & ActiveCell.Offset(0, -ActiveCell.Column + 6)
CostPerUnit1 = "£" & TotalCost1 / NumberIssued1.Text
TotalCharge1 = Format(ActiveCell.Offset(0, -ActiveCell.Column + 7)
"£###,###.00")
ChargePerUnit1 = TotalCharge1 / NumberIssued1.Text
CurrentStockLevel1 = (WorksheetFunction.VLookup(BinNumber1.Value, _
Worksheets("Current Stock").Range("A:E"), 5, False))
ReorderLevel1 = (WorksheetFunction.VLookup(BinNumber1.Value, _
Worksheets("Current Stock").Range("A:J"), 10, False))
BinNumber1.RowSource = _
ThisWorkbook.Sheets("curren
stock").Range("a:b").Address(external:=True)

End Sub

Private Sub EnterIssue_click()
ActiveCell.Offset(0, -ActiveCell.Column + 1) = Date1.Value
ActiveCell.Offset(0, -ActiveCell.Column + 2) = JobNumber1.Text
ActiveCell.Offset(0, -ActiveCell.Column + 3) = BinNumber1.Text
ActiveCell.Offset(0, -ActiveCell.Column + 4) = Description1
ActiveCell.Offset(0, -ActiveCell.Column + 5) = NumberIssued1.Text
ActiveCell.Offset(0, -ActiveCell.Column + 6) = TotalCost1
ActiveCell.Offset(0, -ActiveCell.Column + 7) = TotalCharge1
End Su
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top