Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default for x to - next x question

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")

--
Thank you...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default for x to - next x question

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default for x to - next x question

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

"EXCELMACROS" wrote:

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")

--
Thank you...

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default for x to - next x question

Hi

Look at the placement of -1 in the parantheses:

Range("G" & x) = Right(Range("F" & x), Len(Range("F" & x)) - 1)
Range("I" & x) = Right(Range("H" & x), Len(Range("H" & x)) - 1)

Regards,
Per

"EXCELMACROS" skrev i meddelelsen
...
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")

--
Thank you...


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default for x to - next x question

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?
--
Thank you...


"Mike H" wrote:

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

"EXCELMACROS" wrote:

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")

--
Thank you...



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default for x to - next x question

PLEASE IGNORE my last comment, very stupid from my end, it is working
perfectly.
--
Thank you...


"EXCELMACROS" wrote:

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?
--
Thank you...


"Mike H" wrote:

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

"EXCELMACROS" wrote:

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")

--
Thank you...

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
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM


All times are GMT +1. The time now is 12:15 AM.

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

About Us

"It's about Microsoft Excel"