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: 1
Default variable number of rows.

I have created this macro but it cuts off if I have too many rows. Is there a
way to make it run until it hits a blank cell in another column? Here is the
code I have now.

feel free to e-mail me if you need more information.

Sub Macro7()
'
' Macro7 Macro
'

'
Columns("I:I").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("H:H").EntireColumn.AutoFit
Range("I2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-8]=RC[-1],""Goto_View"",""Goto_View_External"")"
Range("I2").Select
Selection.Copy
Range("H2").Select
Selection.End(xlDown).Select
Range("I60487").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("A60486").Select
Selection.End(xlUp).Select
Range("I1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "ACTION"
Range("I1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveWindow.ScrollRow = 60216
ActiveWindow.ScrollRow = 59474
ActiveWindow.ScrollRow = 57743
ActiveWindow.ScrollRow = 55270
ActiveWindow.ScrollRow = 51561
ActiveWindow.ScrollRow = 47109
ActiveWindow.ScrollRow = 42658
ActiveWindow.ScrollRow = 38578
ActiveWindow.ScrollRow = 34869
ActiveWindow.ScrollRow = 31407
ActiveWindow.ScrollRow = 28068
ActiveWindow.ScrollRow = 25101
ActiveWindow.ScrollRow = 23122
ActiveWindow.ScrollRow = 20402
ActiveWindow.ScrollRow = 18919
ActiveWindow.ScrollRow = 17558
ActiveWindow.ScrollRow = 16198
ActiveWindow.ScrollRow = 14838
ActiveWindow.ScrollRow = 13602
ActiveWindow.ScrollRow = 12365
ActiveWindow.ScrollRow = 11376
ActiveWindow.ScrollRow = 10263
ActiveWindow.ScrollRow = 9522
ActiveWindow.ScrollRow = 8409
ActiveWindow.ScrollRow = 7667
ActiveWindow.ScrollRow = 6801
ActiveWindow.ScrollRow = 5936
ActiveWindow.ScrollRow = 4699
ActiveWindow.ScrollRow = 3216
ActiveWindow.ScrollRow = 1732
ActiveWindow.ScrollRow = 372
ActiveWindow.ScrollRow = 1
Range("E1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns("I:I").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("I2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-4]=""Goto_View"","""",RC[-1])"
Range("I2").Select
Selection.Copy
Range("H2").Select
Selection.End(xlDown).Select
Range("I60487").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.End(xlUp).Select
Range("I1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "DEST. FILE"
Range("I1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.End(xlUp).Select
Range("H1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll Down:=9
Range("H1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns("I:I").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
ActiveWindow.LargeScroll ToRight:=1
Columns("W:W").Select
Selection.Cut
ActiveWindow.LargeScroll ToRight:=-1
Columns("A:A").Select
ActiveSheet.Paste
ActiveWindow.LargeScroll ToRight:=1
Range("T2").Select
Selection.Copy
Columns("T:T").Select
Selection.Replace What:="ACROBAT_DEFAULT", Replacement:="NEW_WINDOW", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:= _
False, ReplaceFormat:=False
Range("T3").Select
Application.CutCopyMode = False
Range("T1").Select
ActiveWindow.LargeScroll ToRight:=-1
Range("A1").Select
Selection.End(xlDown).Select
Range("A1").Select
Selection.End(xlDown).Select
Rows("60488:60488").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("A:A").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
Range("A1").Select
End Sub



 
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
Count the Number of Variable Rows Paul Black Excel Programming 7 September 2nd 07 11:05 AM
Linking to a Variable Number of Rows - XP/07 RFJ Excel Worksheet Functions 4 May 17th 07 07:53 PM
insert variable number of rows tina Excel Programming 1 February 9th 05 01:18 PM
Paste to variable number of rows brook6 Excel Programming 0 April 5th 04 09:36 PM
Paste to variable number of rows Doug Glancy Excel Programming 0 April 1st 04 01:09 AM


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