MBESSANT
02-24-2009, 03:22 AM
I have made a userform in excel and used command buttons to control different macros. Error 2147417848 (80010108) keeps on closing Excel.
What am i doing wrong?:banghead:
I know the code is written very well its my second time a writing code.
Thanks for helping
Sub BPOK()
Selection.Cut
Sheets("Made").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Need").Select
Selection.Delete Shift:=xlUp
BoatPick.Hide
Call SortMade
Call SortNeed
Sheets("Need").Select
End Sub
Sub SortMade()
Sheets("Made").Select
Columns("A:F").Select
Selection.Sort Key1:=Range("D1"), Order1:=xlAscending, Key2:=Range("A1") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A1").Select
End Sub
Sub SortNeed()
Sheets("Need").Select
Columns("A:F").Select
Selection.Sort Key1:=Range("D1"), Order1:=xlAscending, Key2:=Range("A1") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A1").Select
End Sub
Sub Blem()
Selection.Copy
Sheets("Need").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Made").Select
Range("A" & BoatReturn.ListBox1.ListIndex + 2).Select
With ActiveCell
Cells(.Row, "B").Select
Application.CutCopyMode = False
Selection.Value = ("BLEM")
End With
Call SortMade
Call SortNeed
BoatReturn.Hide
End Sub
Sub Scrap()
Selection.Copy
Sheets("Need").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Scrap").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Made").Select
Range("A" & BoatReturn.ListBox1.ListIndex + 2).Select
With ActiveCell
Cells(.Row, "B").Select
Application.CutCopyMode = False
Selection.Value = ("SCRAP")
End With
Call SortMade
Call SortNeed
BoatReturn.Hide
End Sub
Sub UK1st()
Selection.Copy
Sheets("Need").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Made").Select
Range("A" & BoatReturn.ListBox1.ListIndex + 2).Select
With ActiveCell
Cells(.Row, "B").Select
Application.CutCopyMode = False
Selection.Value = ("UK1st")
End With
Call SortMade
Call SortNeed
BoatReturn.Hide
End Sub
What am i doing wrong?:banghead:
I know the code is written very well its my second time a writing code.
Thanks for helping
Sub BPOK()
Selection.Cut
Sheets("Made").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Need").Select
Selection.Delete Shift:=xlUp
BoatPick.Hide
Call SortMade
Call SortNeed
Sheets("Need").Select
End Sub
Sub SortMade()
Sheets("Made").Select
Columns("A:F").Select
Selection.Sort Key1:=Range("D1"), Order1:=xlAscending, Key2:=Range("A1") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A1").Select
End Sub
Sub SortNeed()
Sheets("Need").Select
Columns("A:F").Select
Selection.Sort Key1:=Range("D1"), Order1:=xlAscending, Key2:=Range("A1") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("A1").Select
End Sub
Sub Blem()
Selection.Copy
Sheets("Need").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Made").Select
Range("A" & BoatReturn.ListBox1.ListIndex + 2).Select
With ActiveCell
Cells(.Row, "B").Select
Application.CutCopyMode = False
Selection.Value = ("BLEM")
End With
Call SortMade
Call SortNeed
BoatReturn.Hide
End Sub
Sub Scrap()
Selection.Copy
Sheets("Need").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Scrap").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Made").Select
Range("A" & BoatReturn.ListBox1.ListIndex + 2).Select
With ActiveCell
Cells(.Row, "B").Select
Application.CutCopyMode = False
Selection.Value = ("SCRAP")
End With
Call SortMade
Call SortNeed
BoatReturn.Hide
End Sub
Sub UK1st()
Selection.Copy
Sheets("Need").Select
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("Made").Select
Range("A" & BoatReturn.ListBox1.ListIndex + 2).Select
With ActiveCell
Cells(.Row, "B").Select
Application.CutCopyMode = False
Selection.Value = ("UK1st")
End With
Call SortMade
Call SortNeed
BoatReturn.Hide
End Sub