Sequential Number Based On Given Number

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,105
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all..

how to make sequential number with parameter
my target in column "interval" and "given" number as parameter (based on)
like this layout :
<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC ;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC ;
}
.tableizer-table th {
background-color: #104E8B ;
color: #FFF ;
font-weight: bold;
}
</style>
<table class="tableizer-table">
<thead><tr class="tableizer-firstrow"><th>given</th><th>data</th><th>interval</th></tr></thead><tbody>
<tr><td>1</td><td>a</td><td>0</td></tr>
<tr><td> </td><td>b</td><td>1</td></tr>
<tr><td> </td><td>c</td><td>2</td></tr>
<tr><td> </td><td>d</td><td>3</td></tr>
<tr><td> </td><td>e</td><td>4</td></tr>
<tr><td> </td><td> </td><td> </td></tr>
<tr><td>given</td><td>data</td><td>interval</td></tr>
<tr><td>3</td><td>a</td><td>0</td></tr>
<tr><td> </td><td>b</td><td>3</td></tr>
<tr><td> </td><td>c</td><td>6</td></tr>
<tr><td> </td><td>d</td><td>9</td></tr>
<tr><td> </td><td>e</td><td>12</td></tr>
</tbody></table>

any help, greatly appreciated...

.sst
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
This code will fill column "Interval" based on columns "A" & "B"
Code:
[COLOR="Navy"]Sub[/COLOR] MG02Apr17
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range, Temp [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] R [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] c [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Set[/COLOR] Rng = Range("B:B").SpecialCells(xlCellTypeConstants)
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng.Areas
    Temp = Dn(2).Offset(, -1)
        [COLOR="Navy"]For[/COLOR] R = 2 To Dn.Count
            Dn(R).Offset(, 1).Value = c * Temp
            c = c + 1
        [COLOR="Navy"]Next[/COLOR] R
        c = 0
[COLOR="Navy"]Next[/COLOR] Dn
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,226,730
Messages
6,192,703
Members
453,748
Latest member
akhtarf3

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
Back
Top