View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 788
Default 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?