Help with inserting next Text based Number

Gregm66

Board Regular
Joined
Jan 23, 2016
Messages
170
Hi Everyone,

I wish to Auto insert a text based number into a worksheet using vba...
The text based numbers appear like this "BCPSC01", i have tried a few different methods but no success so far, i know this is possible to do.
the numbers will continue to run consecutively.

Thankyou in advance...
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
How will they run consecutively? Just BCPSC01-BCPSC99? What comes next? BCPSC100? Or do the letters change?
 
Upvote 0
How will they run consecutively? Just BCPSC01-BCPSC99? What comes next? BCPSC100? Or do the letters change?

The numbers run as follows,
BCPSC01
BCPSC02
BCPSC03

and so on, but only to go into column "A" if a name has been selected in column "B", i have the following code that inserts a number only IE: 1 next cell 2 and so on it wont insert the BCPSC part.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim cell As Range
    If Not Intersect(Range("B:B"), Target) Is Nothing Then
        For Each cell In Intersect(Range("B:B"), Target).Cells
            If cell.Value <> "" And Range("A" & cell.Row).Value = "" Then
                Range("A" & cell.Row).Value = Application.Max(Range("A:A")) + 1
            End If
        Next
    End If
End Sub
 
Upvote 0
Thanks to everyone who looked at my post, and or replied.

I have solved my problem by creating a user form to add all my data and to create a membership number consisting of text and numbers...

Thankyou all
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,025
Members
448,543
Latest member
MartinLarkin

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