Add +1 to a cell value (plus complications!)

s_macloskey

New Member
Joined
Jul 1, 2020
Messages
30
Office Version
  1. 365
Platform
  1. Windows
Good morning all,

I have another VBA/AcitveX/Button query that I hope someone can help me to solve!

Also please forgive me as I don't 100% know the QUESTION I am asking, I just know the result I am after.

(I have also have to redact some of the information becuase of where I work.)

Context:

Until it 'broke', we use(d) a shared sheet to generate new "case numbers" (see pictures)

I am creating a new sheet because somewhere along the line something went wrong and it is broken (and it looks like the last IT guy used Unviewable+VBA so I can't get into the VBA so see what he used)

Desired result:

(-) and (+) buttons that adds (and subtracts) 1 to a cell value (from 000 - 999)

then IDEALLY (see picture) once past 999 to go from X00XX999 to X01XX000 (then X01XX001, 002, 003...)

Now I don't know how exactly so explain this.... The last IT guy made it so that somehow the cell value displayed as e.g X00XX123, even though in the formula bar it just displayed as 123 and I have absolutely no idea how he did this... Ive attached a picture to add context.


I tried an ActiveX spin button with:

Private Sub SpinButton1_Change()
If ("C3") = vbNullString Then SpinButton1.Value = 1
Range("C3").Value = SpinButton1.Value
End Sub


But this only goes up to 100. I need it to go from 000 - 999



Any help or advice whatsoever is appreciated.




Thank you all,

S Macloskey



 

Attachments

  • button 1.png
    button 1.png
    43.5 KB · Views: 27
  • button 2.png
    button 2.png
    7.7 KB · Views: 26
  • button 3.png
    button 3.png
    6.6 KB · Views: 25

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,223,948
Messages
6,175,580
Members
452,653
Latest member
craigje92

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