ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error Message "Runtime error '13' Type mismatch" (https://www.excelbanter.com/excel-programming/377410-error-message-runtime-error-13-type-mismatch.html)

Chris

Error Message "Runtime error '13' Type mismatch"
 
For some reason my program isn't working. In the excel sheet, I have a user
click on a button to open a userform.

Now when that button is clicked, a user gets

Runtime error '13'
Type Mismatch

I click on Debug and it goes to

Sub Show()
UserForm1.Show
End Sub

I have no idea why its doing this all of a sudden. Does anyone else?


Dave Ramage

Error Message "Runtime error '13' Type mismatch"
 
It is likely that there is something in the userform's _Initialize event that
is causing the problem- the debugger will confusingly point to the
Userform.Show line in this case. Click the Step Into debug button and keep
stepping through until you find the line that is causing the issue.

Cheers,
Dave

"Chris" wrote:

For some reason my program isn't working. In the excel sheet, I have a user
click on a button to open a userform.

Now when that button is clicked, a user gets

Runtime error '13'
Type Mismatch

I click on Debug and it goes to

Sub Show()
UserForm1.Show
End Sub

I have no idea why its doing this all of a sudden. Does anyone else?


Tom Ogilvy

Error Message "Runtime error '13' Type mismatch"
 
If could be that some code in the userform is causing the error. This could
be because the code was altered or data that the code was using has now
changed.

--
Regards,
Tom Ogilvy


"Chris" wrote:

For some reason my program isn't working. In the excel sheet, I have a user
click on a button to open a userform.

Now when that button is clicked, a user gets

Runtime error '13'
Type Mismatch

I click on Debug and it goes to

Sub Show()
UserForm1.Show
End Sub

I have no idea why its doing this all of a sudden. Does anyone else?


Chip Pearson

Error Message "Runtime error '13' Type mismatch"
 
In the VBA Editor, go to the Tools menu, choose Options, then the General
tab. There, select the "Break In Class Module" option in the "Error
Trapping" frame. Now run your code. It will break on the actual line of code
that is causing the problem.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)

"Chris" wrote in message
...
For some reason my program isn't working. In the excel sheet, I have a
user
click on a button to open a userform.

Now when that button is clicked, a user gets

Runtime error '13'
Type Mismatch

I click on Debug and it goes to

Sub Show()
UserForm1.Show
End Sub

I have no idea why its doing this all of a sudden. Does anyone else?




Chris

Error Message "Runtime error '13' Type mismatch"
 
Thanks I was able to find out the problem doing that. Somehow the sheet got
changed.

New problem.... Trying to copy info in a cell, copy it, paste in a new
sheet, and then delete from the original sheet. Again it works then stops.
Below is the full code the line that it stops at is
Sheet1.Range("A" & found & ":G" & found).Select


Private Sub CommandButton10_Click()

'Copy Serial Number for deletation and paste into new spreadsheet

test_row = 2
test_value = Sheet1.Range("A" & test_row).Value

While test_value < ""
If test_value = UserForm1.ComboBox11.Value Then
found = test_row
GoTo leaveloop1
End If
test_row = test_row + 1
test_value = Sheet1.Range("A" & test_row).Value
Wend

leaveloop1:
test_row2 = 1
test_value2 = Sheet3.Range("A" & test_row2).Value

While test_value2 < ""
test_row2 = test_row2 + 1
test_value2 = Sheet3.Range("A" & test_row2).Value
Wend

Sheet1.Range("A" & found & ":G" & found).Copy
Sheet3.Range("A" & test_row2).PasteSpecial

UserForm1.ComboBox11.Clear
UserForm1.ComboBox12.Clear

Sheet1.Range("A" & found & ":G" & found).Select
Application.CutCopyMode = xlCut
Selection.Delete Shift:=xlUp

ComboBoxRefresh

End Sub

"Chip Pearson" wrote:

In the VBA Editor, go to the Tools menu, choose Options, then the General
tab. There, select the "Break In Class Module" option in the "Error
Trapping" frame. Now run your code. It will break on the actual line of code
that is causing the problem.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)

"Chris" wrote in message
...
For some reason my program isn't working. In the excel sheet, I have a
user
click on a button to open a userform.

Now when that button is clicked, a user gets

Runtime error '13'
Type Mismatch

I click on Debug and it goes to

Sub Show()
UserForm1.Show
End Sub

I have no idea why its doing this all of a sudden. Does anyone else?






All times are GMT +1. The time now is 02:46 PM.

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