Create a Macro with button to generate the next sequential number in an Alphanumeric string

mangotti

New Member
Joined
Apr 24, 2015
Messages
6
I looking for some assistance in creating a macro that when a button is clicked, the macro sequentially increases an alphanumeric string, example of the string is as follows and the number should increase by 1 after the macro is run.

CA-123456

When macro is run, next alphanumeric will be CA-123457

Thanks!
 
Ah Yes! My apologies. I did not know it was dependent on 6 characters and was testing something else with a different character count. It works indeed. Cheers!

Did you try it? If the last six characters of your field are digits (like you showed in your original message), it will work.
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,215,591
Messages
6,125,711
Members
449,252
Latest member
cryss1988

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