Custom Cell Format

Andy Teal

New member
Local time
Tomorrow, 02:59
Joined
May 11, 2023
Messages
28
URGENT!!!
Hello All. I need to be able to add a number to a cell and then have the following format be automatically filled in. The only other option I would have is to type it all in on all 1300 rows or copy and past and change the number on all 1300 rows which both do not sound like fun at all. See below for the format that it needs to look like when I enter a number (in this case the number would be 1509 and the rest of the info and characters will be the same on every row. I can not add any more columns or pages or anything like that at all due to when I import this back into the system I exported from it will throw errors and not work. Thank you all for any help you can give

{1509~1509~26 no FC~Active~~~}
 
Try:-

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim inputVal As String
    If Target.Cells.Count > 1 Then Exit Sub
    
    ' Check if the input is numeric
    If IsNumeric(Target.Value) Then
        inputVal = Target.Value
        Target.Value = "{" & inputVal & "~" & inputVal & "~26 no FC~Active~~~}"
    End If
End Sub
 
Not beyond the realm of reason, to use a helper column and the place that instead of your errant column.
A formula, a copy and paste of that formula, a copy and insert of that column, then delete that column from it's original position.
Could also be automated using the macro recorder.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom