Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumif text is contained winthin a longer text string in a cell Johnny M[_2_] Excel Worksheet Functions 3 March 21st 07 02:50 PM
Text does not display in "Text boxs" and when wrapping text in a c Esteban Excel Discussion (Misc queries) 1 March 8th 07 11:59 PM
merged cells into one text cell, size varies dependant on text dat Jazzylady825 Excel Discussion (Misc queries) 0 December 9th 05 08:26 PM
convert a range of lowercase text to upper text or vice versa jackdaw Excel Worksheet Functions 2 May 16th 05 09:31 PM
Macro or Function to make text size to suite text Length? lbbss Excel Discussion (Misc queries) 4 December 14th 04 07:53 PM


All times are GMT +1. The time now is 11:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"