LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Limit .find to one pass

The following code loops through certain columns and removes the last
character in the data. My data arrangement has changed a little and
now the code continuously loops through the data removing the last
character until there is not data. Its funny to watch but I need to
fix it...

How can I limit the code to make just one pass? Too bad there is not a
"before" attribute.

thanks
Robert

Do Until ActiveCell.Value = ""

Cells.Find(what:="LC", After:=ActiveCell, LookIn:=xlValues,
lookat:= _
xlPart, searchorder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=
False, SearchFormat:=False).Activate

ActiveCell.Offset(1, 0).Select

Do Until ActiveCell.Value = ""

'Copy the right-most character to the next column
ActiveCell.Offset(0, 1).Value = Right$
(ActiveCell.Value, 1)
'Cut off the right-most character
ActiveCell.Value = Left$(ActiveCell.Value, Len
(ActiveCell.Value) - 1)
'ActiveCell = ActiveCell.Offset(1, 0)
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Offset(-r, 1).Select 'move up and to next column

Loop
 
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
Conditional Formatting - Getting pass the 3 condition limit Judy Rose Excel Discussion (Misc queries) 11 May 20th 08 07:33 PM
Cells.Find: Why can't I pass a variable? Rick S. Excel Discussion (Misc queries) 10 October 4th 07 07:50 PM
Conditional Formatting - Getting pass the 3 condition limit Hadidas Excel Discussion (Misc queries) 4 July 13th 06 06:45 PM
How do I my find pass word in excel AlShepard Setting up and Configuration of Excel 0 February 6th 06 09:32 PM
Find a Value Pass Row 99 skid Excel Programming 4 June 23rd 05 05:18 AM


All times are GMT +1. The time now is 09:47 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"