Share via

Having Trouble with Barcode format?

Anonymous
2012-04-11T15:19:42+00:00

I have written code to change a value EX:(-239.0) into the ABS form and into a barcode form. But when it changes the value to barcode it drops the decimal point if a zero exist just like the example. How can I keep the decimal point if a zero exist?

Radial: -16692.0
*16692*
Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

7 answers

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2012-05-02T18:08:15+00:00

    If I change the columns to a text format it actually removes the decimal point entirely?

    Then your macro changes the cell format, try this macro in a new file.

    Sub Test()

      Range("A1").NumberFormat = "@"

      Range("A1") = "239.00"

    End Sub

    Andreas.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-05-02T12:51:00+00:00

    No luck,

    If I change the columns to a text format it actually removes the decimal point entirely?

    For my colums I have

    Weight(Lbs) Changed weight Deviation Calculated Barcode
    15 =15/10 =(15/10)+230 =*&((15/10)+230)&*
    0 0 0
    0 0 0
    0 0 0

    The Weight is sent from the scale and the barcode is created and printed by a macro.

    Was this answer helpful?

    0 comments No comments
  3. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2012-04-29T13:09:39+00:00

    Format the cell (all related cells) as Text and enter the number again.

    Andreas.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2012-04-27T12:02:01+00:00

    Cristin,

    I was not able to successfully use any of your suggested methods to solve my problem. I'm still having the complication of the cell that contains

    = "*" & Cell & "*"

    If the cell value = 19.00

    The cell will = *19*  ??

    Its a very confusing issue

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2012-04-12T10:19:20+00:00

    Hello,

    Method 1:

    Please go thru the following steps:

    Right-click the cell >> Format Cells... >> Number >> Decimal places >> set the value 1

    Method 2:

    Type '-16692.0 in a cell.

    Method 3:

    Sub SetNumFormat()

        Range("A1").NumberFormat = "0.0"

    End Sub

    Method 4:

    Sub SetFormat(ByVal strValue As String, rngTarget As Range)

        rngTarget.Formula = "=CONCATENATE(""" + strValue + """)"

    End Sub

    'Test this macro to see the value in active cell.

    Sub Test()

        SetFormat "-16692.0", ActiveCell

    End Sub

    Cheers,

    Cristin

    Was this answer helpful?

    0 comments No comments