Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Continue running macro until last line of data.

Using Excel 2003 I am attempting to create a macro where I can copy a set of
numbers, transpose them, sort them and copy/transpose them back to their
original location.

I have the macro working but I do not know how to have the application
continue the function until it has reached the end of my data set. I
currently have the macro running ten lines of data and then it stops.

(Example)
Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Range("X1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Columns("X:X").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("X1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("X1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Range("C1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Range("X1").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.ClearContents

I have this code down to C10 but unfortunately, I have thousands of lines of
data so I need to enter code that keeps the macro running until it has
reached the end of my data set. The total number of lines varies from
hundreds to thousands.

I am sure there is a simple answer but I am having trouble figuring it out.
Any help would be greatly appreciated.

Steve

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
can I write an Excel macro to pause for data entry then continue? kiwiwaldo Excel Discussion (Misc queries) 3 June 30th 08 10:25 AM
Can you pause a macro in excel to input data and continue? Hutch Excel Discussion (Misc queries) 1 May 5th 06 06:16 PM
Continue line of VBA code on the next line peacelittleone Excel Programming 9 June 24th 05 07:46 PM
Running a macro from the command line Czech Excel Programming 1 October 28th 04 09:51 PM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski[_2_] Excel Programming 1 May 28th 04 06:50 PM


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