Help with excel looping

qnatz

New Member
Joined
Jul 20, 2010
Messages
6
Hey Guys, am seroiusly stack.
Am doin a serial number issuer for ma company.
<table style="border-collapse: collapse; width: 501px; height: 280px;" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" span="4" width="64"> <col style="width: 58pt;" span="2" width="77"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt; width: 48pt;" height="20" width="64"> </td> <td class="xl65" style="width: 48pt;" width="64"> </td> <td class="xl66" style="width: 48pt;" width="64"> </td> <td class="xl65" style="width: 48pt;" width="64"> </td> <td class="xl65" style="width: 58pt;" width="77"> </td> <td class="xl65" style="width: 58pt;" width="77"> </td> <td class="xl65" style="width: 48pt;" width="64"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl67">PackSize</td> <td class="xl67" style="border-left: medium none;">#Labels</td> <td class="xl68" style="width: 48pt;" width="64"> </td> <td class="xl69" style="width: 58pt;" width="77">Serial From</td> <td class="xl70" style="border-left: medium none;">Serial t0</td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl65" align="right">2</td> <td class="xl65" align="right">250</td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;" align="right">0000000001</td> <td class="xl72" style="border-top: medium none; border-left: medium none;" align="right">0000000251</td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl65" align="right">5</td> <td class="xl65" align="right">80</td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;" align="right">0000000252</td> <td class="xl72" style="border-top: medium none; border-left: medium none;" align="right"> 0000000332</td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl65" align="right">2</td> <td class="xl65" align="right">500</td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;" align="right">0000000333</td> <td class="xl72" style="border-top: medium none; border-left: medium none;" align="right">0000000833</td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl65" align="right">2</td> <td class="xl65" align="right">250</td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;" align="right">0000000834</td> <td class="xl72" style="border-top: medium none; border-left: medium none;" align="right">0000001084</td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl65"> </td> <td class="xl65"> </td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;"> </td> <td class="xl72" style="border-top: medium none; border-left: medium none;"> </td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl65"> </td> <td class="xl65"> </td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;"> </td> <td class="xl72" style="border-top: medium none; border-left: medium none;"> </td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl65"> </td> <td class="xl65"> </td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;"> </td> <td class="xl72" style="border-top: medium none; border-left: medium none;"> </td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl65"> </td> <td class="xl65"> </td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;"> </td> <td class="xl72" style="border-top: medium none; border-left: medium none;"> </td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl73"> </td> <td class="xl73"> </td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;"> </td> <td class="xl72" style="border-top: medium none; border-left: medium none;"> </td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl73"> </td> <td class="xl73"> </td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;"> </td> <td class="xl72" style="border-top: medium none; border-left: medium none;"> </td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl73">
</td> <td class="xl73"> </td> <td class="xl71"> </td> <td class="xl72" style="border-top: medium none;"> </td> <td class="xl72" style="border-top: medium none; border-left: medium none;"> </td> <td class="xl65"> </td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl64" style="height: 15pt;" height="20"> </td> <td class="xl74">Totol</td> <td class="xl74" align="right">1080</td> <td class="xl71"> </td> <td class="xl75" style="border-top: medium none;"> </td> <td class="xl70" style="border-top: medium none; border-left: medium none;"> </td> <td class="xl65"> </td> </tr> </tbody></table>

dont know how to upload the xls but roughly this is it.
important in the number of labels,the starting and end serials.
i want to send this data in a way that each row here sends data to another sheet with serials from start all the way to the end, this should be done for each row here till the last data row. that is on the second sheet i expect to have 1080 rows of data.

please somebody

Regards
Qnatz
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

qnatz

New Member
Joined
Jul 20, 2010
Messages
6
Yes Boss, exactly thats it.
the cell fomulae aint ma problem tho...
i've put a print button down the sheet when pressed each row goes to print queue sheet laying out serials from...to.
And thanx for the reply i really appreciate yo help.

Regards
Qnatz
 

qnatz

New Member
Joined
Jul 20, 2010
Messages
6
hey guyz can some body help me here.
this problem seems simple but alito tricky especially for a novice like me
 

qnatz

New Member
Joined
Jul 20, 2010
Messages
6

ADVERTISEMENT

i guess no answer...

am kinda gettin a lead here,

a= Range("C:C")
b=Range("D:D")

For i = a to b then
.. print to column F first empty row
a to b
End for
Next i


can someone follow this flow
 

qnatz

New Member
Joined
Jul 20, 2010
Messages
6
Hey guys

found ma self mixing up codes from every where n almost got something,
its almost wat i want just a few add up. here's the code


Sub SetVarFromCell()
Dim FTW As Long
Dim FTX As Long
Dim i As Variant
Dim r As Long
'following VoGs image of the xl sheet 1
Worksheets("Sheet1").Activate
FTW = Cells(2, "C").Value
FTX = Cells(2, "D").Value

For i = FTW To FTX
Cells(i, 1) = i
Next i

For r = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Cells(r, 1) = "" Then Rows(r).Delete
Next r

End Sub


can some one help
 

qnatz

New Member
Joined
Jul 20, 2010
Messages
6
ok finally i get wat i want. herez the code

Sub SetVarFromCell()
Dim FTW As Long
Dim FTX As Long
Dim i As Variant
Dim r As Long

Worksheets("Sheet1").Activate
FTW = Cells(12, "F").Value
FTX = Cells(12, "G").Value

For i = FTW To FTX
nextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(nextRow, 1) = i
Next i

End Sub

could be useful to someone
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,030
Messages
5,856,935
Members
431,841
Latest member
jaybeem

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top