K
Kev
Sub CustAllocInput_AutoShape1_Click()
UserForm1.Show
Sheets("CustAllocInput").Select <---------HERE
Range("CustList1").Select
End Sub
*****************************************
Private Sub cmdOk_Click()
CustName = UserForm1.CustName
If CustName = "" Then End??????
Set Customers = Sheets("Customer List").Range
("Customers")
If WorksheetFunction.CountIf(Customers, CustName) > 0
Then End?????
With Sheets("Customer List")
clastrow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("A" & clastrow + 1).Value = CustName
.Range("Customers").Cells(1, 1).Resize(clastrow +
1, Range("Customers").Columns.Count).Name = "Customers"
End With
Unload Me
Sheets("Customer List").Select
Selection.Sort Key1:=Range("Customers"),
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub
If cmdOK routine runs all the way I return to <---- HERE
in my starting code block. However the two Then End?????
statements do not? What have I overlooked???
Thanks to all once again.....
Kev.
UserForm1.Show
Sheets("CustAllocInput").Select <---------HERE
Range("CustList1").Select
End Sub
*****************************************
Private Sub cmdOk_Click()
CustName = UserForm1.CustName
If CustName = "" Then End??????
Set Customers = Sheets("Customer List").Range
("Customers")
If WorksheetFunction.CountIf(Customers, CustName) > 0
Then End?????
With Sheets("Customer List")
clastrow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("A" & clastrow + 1).Value = CustName
.Range("Customers").Cells(1, 1).Resize(clastrow +
1, Range("Customers").Columns.Count).Name = "Customers"
End With
Unload Me
Sheets("Customer List").Select
Selection.Sort Key1:=Range("Customers"),
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub
If cmdOK routine runs all the way I return to <---- HERE
in my starting code block. However the two Then End?????
statements do not? What have I overlooked???
Thanks to all once again.....
Kev.