for x to - next x question

  • Thread starter Thread starter EXCELMACROS
  • Start date Start date
E

EXCELMACROS

hi, could someone see what's the problem with the following:

For x = 2 To lastrow
Range("G" & x) = Right(Range("F" & x), Len(Range("F" & x) - 1))
Range("I" & x) = Right(Range("H" & x), Len(Range("H" & x) - 1))
Next x

I just want it to see the previous cell and take one blank space out of the
way. (trim does not work, i.e. " 3.5" and I need "3.5")
 
Try this.

If this helps click Yes
--------------
Jacob Skaria


For x = 2 To lastrow
Range("G" & x) = Right(Range("F" & x), Len(Range("F" & x) )- 1)
Range("I" & x) = Right(Range("H" & x), Len(Range("H" & x) )- 1)
Next x
 
Hi,

You have a syntax error, try this

For x = 2 To LastRow
Range("G" & x) = Right(Range("F" & x), Len(Range("F" & x)) - 1)
Range("I" & x) = Right(Range("H" & x), Len(Range("H" & x)) - 1)
Next x

Mike
 
thanks for catching my error however, when I run it, it partially works, let
me show you:

300 300
500 500
2.200 2.2
300 300
200 200

you can copy paste that..., all my values work but the " 2.200" is returning
"2.2" why is that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top