ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date Type Mismatch (https://www.excelbanter.com/excel-programming/335040-date-type-mismatch.html)

johncassell[_5_]

Date Type Mismatch
 

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!!

--
johncassel
-----------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...fo&userid=2501
View this thread: http://www.excelforum.com/showthread.php?threadid=38867


Bob Phillips[_7_]

Date Type Mismatch
 
Are you sure that is the only code? I cannot reproduce the.error

--
HTH

Bob Phillips

"johncassell"
wrote in message
...

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 date
which is in column A of the active row.

On closing my userform, my textbox puts whatever is in the date1.text
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", I
then hit my update command button and the form closes. When I go to
open the userform using the same row VB says "Run-time error '13': Type
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!!!


--
johncassell
------------------------------------------------------------------------
johncassell's Profile:

http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=388676




johncassell[_6_]

Date Type Mismatch
 

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

--
johncassel
-----------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...fo&userid=2501
View this thread: http://www.excelforum.com/showthread.php?threadid=38867


Bob Phillips[_7_]

Date Type Mismatch
 
Sorry, I still cannot reproduce the problem.

--
HTH

Bob Phillips

"johncassell"
wrote in message
...

This is the whole version of my code (I assumed the bit I posted was the
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("current
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 Sub


--
johncassell
------------------------------------------------------------------------
johncassell's Profile:

http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=388676





All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com