-3

Please any one can help me in this, I need to fill the cells with one number and one char like this ("A6") with no repeat in vertical column,

table will be like this

if you can give me a vba code or any other things to do it, Thank you..

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
  • Welcome to Stack Overflow. Please note that because this is no free code writing service it is necessary that you show either what you have tried so far and where you got stuck or errors (by showing your code) or at least to show what you have researched and the effort you made. Otherwise it is just asking us to do all the work for you. Reading [ask] might help you to improve your question. – Pᴇʜ Jan 18 '21 at 08:04

1 Answers1

0

Just loop through any row, and generate random number and random character, something like this:

For i = 1 To row_limit
    For j = 1 To column_limit
        try_cell = CStr(Int((upperbound - lowerbound + 1) * Rnd + lowerbound)) & Random_char() 'generate random cell address
        Do While True 'check if current 'cell' generated in row
            before = try_cell
            For w = 1 To j
                If try_cell = shee1.Cells(i, w) Then 'means it already exits and need to generate again
                    try_cell = CStr(Int((upperbound - lowerbound + 1) * Rnd + lowerbound)) & Random_char()
                    Exit For
                End If
            Next
            If before = try_cell Then 'only if not in row, move on
                sheet1.Cells(i, j) = try_cell
                Exit Do
            End If
        Loop
    Next
Next

You can check how to generate random char here Random String & Number Generation access vba