Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format from Row Source
Hi All
We use a fair few numbers with a leading zero - enters OK in a UserForm textbox Tb1, however it always drops it on entering the cell on the sheet. Is there anyway to retain the format of a leading zero. The code for the row source is below. Range(Me.Lb1.RowSource).Resize(1, 1).Offset(Me.Lb1.ListIndex, 3) = Me.Tb1.Value -- Many thanks hazel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format from Row Source
You could format that cell as text, then plop the value into it:
with Range(Me.Lb1.RowSource).Resize(1, 1).Offset(Me.Lb1.ListIndex, 3) .numberformat = "@" .value = Me.Tb1.Value end with Or you could prefix the value with an apostrophe: Range(Me.Lb1.RowSource).Resize(1, 1).Offset(Me.Lb1.ListIndex, 3).value _ = "'" & me.Tb1.Value Hazel wrote: Hi All We use a fair few numbers with a leading zero - enters OK in a UserForm textbox Tb1, however it always drops it on entering the cell on the sheet. Is there anyway to retain the format of a leading zero. The code for the row source is below. Range(Me.Lb1.RowSource).Resize(1, 1).Offset(Me.Lb1.ListIndex, 3) = Me.Tb1.Value -- Many thanks hazel -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can Not get cell to accept any format change! Source from html | Excel Worksheet Functions | |||
Pivot Table Format from Source Data | Excel Discussion (Misc queries) | |||
How to retain format for linked data source | Charts and Charting in Excel | |||
Pivot Table Row Field Format (OLAP Source) | Excel Discussion (Misc queries) | |||
how do I format a cell reference to move as source changes | Excel Worksheet Functions |