Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Loop Statment help!

Can some one tell me how to set up this code as a loop
statment so I only have to preform the funtion once and
the code will preform until the last row of my range has
been moved.

here is the code I have.

Sub MoveUSDown()

Application.ScreenUpdating = False


ActiveCell.Name = "MoveUS1"
Cells.Find(What:="Totals in USD:",
After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
MatchCase:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
ActiveCell.Offset(0, 3).Range("A1").Select
ActiveCell.Name = "MoveUS2"
Range("MoveUS1:MoveUS2").Select
Selection.Cut Destination:=ActiveCell.Offset(1, 0)
Range("W3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-21]=RC[3],""Y"",IF(RC
[3]="""",""A"",""""))"
Range("W3").Select
Selection.AutoFill Destination:=Range("W3:W219")
Range("MoveUS2").Select
ActiveWorkbook.Names("MoveUS2").Delete
Range("MoveUS1").Select
ActiveWorkbook.Names("MoveUS1").Delete
ActiveCell.Offset(-1, -3).Range("A1").Select
Selection.ClearContents

End Sub

In my code I put a Y,A or blank in the cell across from my
list to let me know which cells have to be moved next. If
we don't need that please feel free to take it out.

Thanks for any help.
Pete
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loop Statment help!

to be honest Pete, I don't understand what your macro does! Can you mai
me the file it operates on (if it's not too large), I think this shoul
help.
--
Message posted from
http://www.ExcelForum.com

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
If statment Cerealkiller via OfficeKB.com Excel Discussion (Misc queries) 5 May 28th 10 10:09 PM
Help with If statment pm Excel Discussion (Misc queries) 3 January 29th 08 04:09 PM
If statment Jason Excel Discussion (Misc queries) 3 January 3rd 08 11:39 PM
if statment Dreamstar_1961 Excel Worksheet Functions 5 April 17th 07 01:30 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 07:59 AM.

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"