0

I'm going to add a zero to the beginning of the numbers. I wrote the following commands, but it is not responding, unfortunately :(

    For Each icell In Rng
        icell.Value = "0" & icell.Value
    Next

Is it possible to guide me? thank you

    Dim Rng As Excel.Range
    Dim icell As Excel.Range

    Rng = Globals.ThisWorkbook.Application.InputBox("Select a Range",,,,,,, 8)

    For Each icell In Rng
        icell.Value = "0" & icell.Value
    Next`
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45

1 Answers1

0

Try this.

Dim Rng As Excel.Range
Dim icell As Excel.Range
Rng = Globals.ThisWorkbook.Application.InputBox("Select a Range",,,,,,, 8)
For Each icell In Rng
  icell.Value = icell.Value.PadLeft(2, '0')
Next