user3122463
user3122463

Reputation: 11

Get a number froma range with the number format

I need to retrieve a number from a cell with the format e.g. cell A1 contains the number "001", but when I apply that to a variable it becomes "1". How do i retrieve "001"??

Tgtval = Range("A1")

Upvotes: 0

Views: 40

Answers (1)

Dmitry Pavliv
Dmitry Pavliv

Reputation: 35863

Try using the Text property:

Tgtval = Range("A1").Text

Upvotes: 1

Related Questions