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: 19
  • button 2.png
    button 2.png
    7.7 KB · Views: 17
  • button 3.png
    button 3.png
    6.6 KB · Views: 17

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,214,622
Messages
6,120,585
Members
448,972
Latest member
Shantanu2024

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