Add next sequence number in next blank row cell only..Excel VBA program

Akash030193

New Member
Joined
Apr 28, 2019
Messages
22
Hello! I need your help in below query.

I am looking for a VBA program that help me to add next sequence number in next blanks row cell only (one cell only). For example, 5th row is blank cell, i need to place next sequence number as "3". Similarly in the same column, refer row 9, i need to place next sequence number as "3"... similarly for all subsequent series..

1) Question
A
1Revision
20
31
42
5
60
71
82
9
100
111
122
13
140
151
162
17

<tbody>
</tbody>

After applying macro
A
1Revision
20
31
42
53
60
71
82
93
100
111
122
133
140
151
162
173

<tbody>
</tbody>


2) Second Example

Question

A
10
20
30
4
50
60
7

<tbody>
</tbody>


After applying macro

A
10
20
30
41
50
60
71

<tbody>
</tbody>


Code to be run if there is any next blank row in the column "A", and to be run for one next cell only.



https://1drv.ms/x/s!AgoBOBbQ2MyJgQcKF83--PVdg_3j



****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">A1Revision2031425
6071829
10011112213
14015116217
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Can you please advise following macro

Row 1 to 5 in column A is filled with some text.
Row 6 in same column is empty..
Row 7 to 10 in same column is filled with some text
Row 11 in same column is empty..vice versa

I want a macro that fill all blank column (6, 11, etc) with text “AAA”. Please help
 
Upvote 0
Can you please advise following macro

Row 1 to 5 in column A is filled with some text.
Row 6 in same column is empty..
Row 7 to 10 in same column is filled with some text
Row 11 in same column is empty..vice versa

I want a macro that fill all blank column (6, 11, etc) with text “AAA”. Please help

Please help
 
Upvote 0
In continuation with above macro, I want to update sequence number as A B C D....next blank row to be filled with next sequence number, if

For example,
ColumnA
1A
2
3A
4
5A
6A
7
8A
9
10B
11
12A

<tbody>
</tbody>
Answer to be..
ColumnA
1A
2B
3A
4B
5A
6A
7B
8A
9B
10B
11C
12A

<tbody>
</tbody>
 
Upvote 0
Can you please advise following macro

Row 1 to 5 in column A is filled with some text.
Row 6 in same column is empty..
Row 7 to 10 in same column is filled with some text
Row 11 in same column is empty..vice versa

I want a macro that fill all blank column (6, 11, etc) with text “AAA”. Please help
Will any blanks after the last filled cell need to have "AAA" placed in them? If so, what can be used to determine the last row that fills will need to go down to?
 
Upvote 0
In continuation with above macro, I want to update sequence number as A B C D....next blank row to be filled with next sequence number, if

For example,
ColumnA
1A
2
3A
4
5A
6A
7
8A
9
10B
11
12A

<tbody>
</tbody>
Will the number of blanks between letters always only be one cell or could there be multiple blank cells between letters that need to be filled in?
 
Upvote 0
Give this macro a try...
Code:
Sub FillBlanksWithNextSequenceLetter()
  Dim R As Long
  For R = 2 To Cells(Rows.Count, "A").End(xlUp).Row
    If Cells(R, "A").Value = "" Then
      Cells(R, "A").Value = Chr(Asc(Cells(R - 1, "A").Value) + 1)
    End If
  Next
End Sub
 
Upvote 0
Give this macro a try...
Code:
Sub FillBlanksWithNextSequenceLetter()
  Dim R As Long
  For R = 2 To Cells(Rows.Count, "A").End(xlUp).Row
    If Cells(R, "A").Value = "" Then
      Cells(R, "A").Value = Chr(Asc(Cells(R - 1, "A").Value) + 1)
    End If
  Next
End Sub

thank you very very much
It’s working
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,923
Members
448,533
Latest member
thietbibeboiwasaco

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