View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
cherij cherij is offline
external usenet poster
 
Posts: 2
Default Exchanging text between two cells

I am trying to preserve the value in the cell as a text value. If I use
number formatting (and set it to 0.000) what happens if I get an entry for
3.1000?


"Toppers" wrote:

Should be:

Cells(nCurrent, 1).NumberFormat = "0.000"


"Toppers" wrote:

Make sure the cells are formatted as TEXT as you save the data into a string.
Or reformat as number e.g. Cells(nCurrent, 1)..NumberFormat = "0.000"

HTH

"cherij" wrote:

I am trying to flip text between two cells:




Dim strTemp As String

strTemp = Cells(nCurrent, 1).Value
Cells(nCurrent, 1).Value = Cells(nCurrent + 1, 1).Value
Cells(nCurrent + 1, 1).Value = strTemp

If I start with "3.100" and "3.10" in the two cells, I end up with 3.1 in
both cells after this code is executed.

Any help is appreciated