Thread: Custom VBA Code
View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
KC Cheung KC Cheung is offline
external usenet poster
 
Posts: 5
Default Custom VBA Code

User will key in anything you least expect them to.

Break the user input qty into two parts.
First part=how many group size;
2nd part=remainder.

if first part0, then do as for group size, loop;
if remainder0, then do as for group size but for remainder qty;
if remainder=0 is automatically taken care of

--
Regards

"Little Penny" wrote in message
...
Long day for me today

Thanks for your reply

The code for the GroupID works as advertised.

Unless I did something wrong the job qty being less the group size
still presents a problem. If it's greater than or equal to it works
great. However I was thinking in reality this should not happen. The
user should adjust the group size. Can I add a line of code to say to
the user if the job qty is less then the group size. The group size
should be changed automatically by the code to equal the job qty. That
would do it.


Thanks







On Sun, 30 Sep 2007 09:05:01 -0700, FSt1
wrote:

hi again,
sorry i'm late.
just after this line
Do While jqm 0
add this......
If jqrb = jq Then
Exit Do
End If
this will solve the job qty being less than or equal to group size. we
call
the group size the lot size here.
as to the other problem....(you have a lot of lots).....in two places in
the
code, replace....
If Len("S000" & c) 5 Then
sp.Value = "S00" & c
Else
sp.Value = "S000" & c
End If
with....
If Len("S00" & c) 5 Then
sp.Value = "S0" & c
Else
If Len("S000" & c) 5 Then
sp.Value = "S00" & c
Else
sp.Value = "S000" & c
End If
End If
this should take your groups to 9999. if you have more lots that that, you
need to revamp your system.