score:3

Accepted answer

Make sure the cell is formatted as text before storing value to it.

.Cells(LR + 1, index).NumberFormat = "@"
.Cells(LR + 1, index).value = "00049875142"

It will be more efficient though to not set format for each cell at a time, but do for the range before looping through and setting the values.

score:2

You can either add leading zeroes with a custom number format (which doesn't seem to be standard across multiple cells) or input the data as text.

.Cells(LR + 1, index).value = "'00049875142"
 'more loops
.Cells(LR + 1, index).value2 = "'0008789875949898451142"

The second needs to be input as text in any event since it is larger than 15 digits and the 15 digit precision rule will truncate off important data.

.Cells(LR + 1, index).numberformat  ="00000000000"
.Cells(LR + 1, index).value = 49875142
 'more loops
.Cells(LR + 1, index).numberformat  ="@"
.Cells(LR + 1, index).value2 = "0008789875949898451142"

Related Query

More Query from same tag