Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
from num to text - end sub
Hello,
We have this code to transform data from num to text I want to exit this code (loop) when there are no more value's in the column (empty) what do i have to edit to that code ? Range("H1:H5200").Select Selection.NumberFormat = "@" Dim cell As Object For Each cell In Selection cell.Value = " " & cell.Value cell.Value = Right(cell.Value, Len(cell.Value) - 1) Next -- תודה רבה |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
from num to text - end sub
Dim cell As Object Range("H1:H5200").NumberFormat = "@" For Each cell In Range("H1:H5200") If cell.Value < "" Then cell.Value = Right(cell.Value, Len(cell.Value) - 1) Else Exit For End If Next cell -- __________________________________ HTH Bob "???? ?????" wrote in message ... Hello, We have this code to transform data from num to text I want to exit this code (loop) when there are no more value's in the column (empty) what do i have to edit to that code ? Range("H1:H5200").Select Selection.NumberFormat = "@" Dim cell As Object For Each cell In Selection cell.Value = " " & cell.Value cell.Value = Right(cell.Value, Len(cell.Value) - 1) Next -- ???? ??? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
from num to text - end sub
thank you Bob, but it make all the range as 'text'
-- תודה רבה "Bob Phillips" wrote: Dim cell As Object Range("H1:H5200").NumberFormat = "@" For Each cell In Range("H1:H5200") If cell.Value < "" Then cell.Value = Right(cell.Value, Len(cell.Value) - 1) Else Exit For End If Next cell -- __________________________________ HTH Bob "???? ?????" wrote in message ... Hello, We have this code to transform data from num to text I want to exit this code (loop) when there are no more value's in the column (empty) what do i have to edit to that code ? Range("H1:H5200").Select Selection.NumberFormat = "@" Dim cell As Object For Each cell In Selection cell.Value = " " & cell.Value cell.Value = Right(cell.Value, Len(cell.Value) - 1) Next -- ???? ??? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
from num to text - end sub
This line formats the entire range as text:
Range("H1:H5200").NumberFormat = "@" If you only want to format the cells that are changed to text: If cell.Value < "" Then cell.numberformat = "@" '<-- added cell.Value = Right(cell.Value, Len(cell.Value) - 1) Else ???? ????? wrote: thank you Bob, but it make all the range as 'text' -- תודה רבה "Bob Phillips" wrote: Dim cell As Object Range("H1:H5200").NumberFormat = "@" For Each cell In Range("H1:H5200") If cell.Value < "" Then cell.Value = Right(cell.Value, Len(cell.Value) - 1) Else Exit For End If Next cell -- __________________________________ HTH Bob "???? ?????" wrote in message ... Hello, We have this code to transform data from num to text I want to exit this code (loop) when there are no more value's in the column (empty) what do i have to edit to that code ? Range("H1:H5200").Select Selection.NumberFormat = "@" Dim cell As Object For Each cell In Selection cell.Value = " " & cell.Value cell.Value = Right(cell.Value, Len(cell.Value) - 1) Next -- ???? ??? -- Dave Peterson |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
from num to text - end sub
that make the different, thank you.
-- תודה רבה "Dave Peterson" wrote: This line formats the entire range as text: Range("H1:H5200").NumberFormat = "@" If you only want to format the cells that are changed to text: If cell.Value < "" Then cell.numberformat = "@" '<-- added cell.Value = Right(cell.Value, Len(cell.Value) - 1) Else ???? ????? wrote: thank you Bob, but it make all the range as 'text' -- ת××× ×¨×× "Bob Phillips" wrote: Dim cell As Object Range("H1:H5200").NumberFormat = "@" For Each cell In Range("H1:H5200") If cell.Value < "" Then cell.Value = Right(cell.Value, Len(cell.Value) - 1) Else Exit For End If Next cell -- __________________________________ HTH Bob "???? ?????" wrote in message ... Hello, We have this code to transform data from num to text I want to exit this code (loop) when there are no more value's in the column (empty) what do i have to edit to that code ? Range("H1:H5200").Select Selection.NumberFormat = "@" Dim cell As Object For Each cell In Selection cell.Value = " " & cell.Value cell.Value = Right(cell.Value, Len(cell.Value) - 1) Next -- ???? ??? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sumif text is contained winthin a longer text string in a cell | Excel Worksheet Functions | |||
Text does not display in "Text boxs" and when wrapping text in a c | Excel Discussion (Misc queries) | |||
merged cells into one text cell, size varies dependant on text dat | Excel Discussion (Misc queries) | |||
convert a range of lowercase text to upper text or vice versa | Excel Worksheet Functions | |||
Macro or Function to make text size to suite text Length? | Excel Discussion (Misc queries) |