VB_Gizmo2018
New Member
- Joined
- Jun 12, 2018
- Messages
- 1
Dear Community,
I am returning back to VBA after a very long break and have managed to forgotten the code to run a macro that adds serial numbers on the left hand side of a blank column from start of the data up to the last row based on a column with last row data which can vary in legth
from
[TABLE="width: 256"]
<colgroup><col width="64" style="width: 48pt;" span="4">
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"]Column A[/TD]
[TD="width: 64, bgcolor: transparent"]Column B[/TD]
[TD="width: 64, bgcolor: transparent"]Column C[/TD]
[TD="width: 64, bgcolor: transparent"]Column D[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]RG4500[/TD]
[TD="bgcolor: transparent, align: right"]1.2[/TD]
[TD="bgcolor: transparent"]Phase 3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]CIV550[/TD]
[TD="bgcolor: transparent, align: right"]33.3[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]RG4400[/TD]
[TD="bgcolor: transparent, align: right"]6.1[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]CV990[/TD]
[TD="bgcolor: transparent, align: right"]0[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]DC20122[/TD]
[TD="bgcolor: transparent, align: right"]6[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]CV990[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]CIV550[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]RG4500[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
to
[TABLE="width: 256"]
<colgroup><col width="64" style="width: 48pt;" span="4">
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"]Column A[/TD]
[TD="width: 64, bgcolor: transparent"]Column B[/TD]
[TD="width: 64, bgcolor: transparent"]Column C[/TD]
[TD="width: 64, bgcolor: transparent"]Column D[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent"]RG4500[/TD]
[TD="bgcolor: transparent, align: right"]1.2[/TD]
[TD="bgcolor: transparent"]Phase 3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]2[/TD]
[TD="bgcolor: transparent"]CIV550[/TD]
[TD="bgcolor: transparent, align: right"]33.3[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]3[/TD]
[TD="bgcolor: transparent"]RG4400[/TD]
[TD="bgcolor: transparent, align: right"]6.1[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]4[/TD]
[TD="bgcolor: transparent"]CV990[/TD]
[TD="bgcolor: transparent, align: right"]0[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]5[/TD]
[TD="bgcolor: transparent"]DC20122[/TD]
[TD="bgcolor: transparent, align: right"]6[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]6[/TD]
[TD="bgcolor: transparent"]CV990[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]7[/TD]
[TD="bgcolor: transparent"]CIV550[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]8[/TD]
[TD="bgcolor: transparent"]RG4500[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
I remember I have to define lastrow variable based on say column B and run the sequence up to 8th row in above example but thats about it.
I didnt find anything similar in existing threads to created this thread
thanks in advance
I am returning back to VBA after a very long break and have managed to forgotten the code to run a macro that adds serial numbers on the left hand side of a blank column from start of the data up to the last row based on a column with last row data which can vary in legth
from
[TABLE="width: 256"]
<colgroup><col width="64" style="width: 48pt;" span="4">
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"]Column A[/TD]
[TD="width: 64, bgcolor: transparent"]Column B[/TD]
[TD="width: 64, bgcolor: transparent"]Column C[/TD]
[TD="width: 64, bgcolor: transparent"]Column D[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]RG4500[/TD]
[TD="bgcolor: transparent, align: right"]1.2[/TD]
[TD="bgcolor: transparent"]Phase 3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]CIV550[/TD]
[TD="bgcolor: transparent, align: right"]33.3[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]RG4400[/TD]
[TD="bgcolor: transparent, align: right"]6.1[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]CV990[/TD]
[TD="bgcolor: transparent, align: right"]0[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]DC20122[/TD]
[TD="bgcolor: transparent, align: right"]6[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]CV990[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]CIV550[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]RG4500[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
to
[TABLE="width: 256"]
<colgroup><col width="64" style="width: 48pt;" span="4">
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"]Column A[/TD]
[TD="width: 64, bgcolor: transparent"]Column B[/TD]
[TD="width: 64, bgcolor: transparent"]Column C[/TD]
[TD="width: 64, bgcolor: transparent"]Column D[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent"]RG4500[/TD]
[TD="bgcolor: transparent, align: right"]1.2[/TD]
[TD="bgcolor: transparent"]Phase 3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]2[/TD]
[TD="bgcolor: transparent"]CIV550[/TD]
[TD="bgcolor: transparent, align: right"]33.3[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]3[/TD]
[TD="bgcolor: transparent"]RG4400[/TD]
[TD="bgcolor: transparent, align: right"]6.1[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]4[/TD]
[TD="bgcolor: transparent"]CV990[/TD]
[TD="bgcolor: transparent, align: right"]0[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]5[/TD]
[TD="bgcolor: transparent"]DC20122[/TD]
[TD="bgcolor: transparent, align: right"]6[/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]6[/TD]
[TD="bgcolor: transparent"]CV990[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]7[/TD]
[TD="bgcolor: transparent"]CIV550[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]Phase 2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]8[/TD]
[TD="bgcolor: transparent"]RG4500[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
I remember I have to define lastrow variable based on say column B and run the sequence up to 8th row in above example but thats about it.
I didnt find anything similar in existing threads to created this thread
thanks in advance