View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default 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