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
 

Some videos you may like

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

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
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,816
Messages
5,513,555
Members
408,958
Latest member
KDox

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top