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

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Akash030193

New Member
Joined
Apr 28, 2019
Messages
22
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
 

Akash030193

New Member
Joined
Apr 28, 2019
Messages
22
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
 

Akash030193

New Member
Joined
Apr 28, 2019
Messages
22
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>
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
35,661
Office Version
2010
Platform
Windows
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?
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
35,661
Office Version
2010
Platform
Windows
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?
 

Akash030193

New Member
Joined
Apr 28, 2019
Messages
22
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?

Yes, number of blanks between letters always be one cell.
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
35,661
Office Version
2010
Platform
Windows
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
 

Akash030193

New Member
Joined
Apr 28, 2019
Messages
22
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
 

Watch MrExcel Video

Forum statistics

Threads
1,089,970
Messages
5,411,577
Members
403,380
Latest member
ifog671

This Week's Hot Topics

Top