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: 44
Default To repeat data row after row.

Hi Sir,

i am trying to extract data from a cell and then return the data into
designated cell. i try to return the data into the next row of cell by
trying to offset to the next row but unsuccessful. See my example,

The problem is: the loop thing still works except that it does not go to the
next empty row/cell for me. it keep on loop at Row1 and non-stop. Where
should i put my Exit Loop if i want it to end after the macro detect no more
data? Pls advise.


Example:

Sub( )

Range("A1").Select
i = ActiveCell.Offset(1, 0).Select

Do Until i = ""

'Line Number
Cells(i, 3).Select
ActiveCell.FormulaR1C1 = _
"=IF(MID(R[5]C[-2],2,1)=""0"",TRIM(MID(R[5]C[-2],2,2))*1,""Z"")"

'Quantity
Cells(i, 4).Select
ActiveCell.FormulaR1C1 = _
"=IF(MID(R[5]C[-3],2,1)=""0"",TRIM(MID(R[5]C[-3],48,7))*1,""Z"")"

'Purchase Order
Cells(i, 5).Select
ActiveCell.FormulaR1C1 = _
"=IF(MID(R[5]C[-4],2,1)=""0"",TRIM(MID(R[5]C[-4],5,7))*1,""Z"")"

'Acknowledgement Status
Cells(i, 6).Select
ActiveCell.FormulaR1C1 = _
"=IF(MID(R[5]C[-5],2,1)=""0"",TRIM(MID(R[5]C[-5],46,1)),""Z"")"

'Part No
Cells(i, 7).Select
ActiveCell.FormulaR1C1 = _
"=IF(MID(R[1]C[-6],2,4)=""PODT"",TRIM(MID(R[1]C[-6],10,29)),""Z"")"

Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

'Delete for Next PN
Range("A1:A26").Select
Range("A26").Activate
Selection.Delete Shift:=xlUp

Loop

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
Repeat row data RussG Excel Discussion (Misc queries) 4 January 27th 09 12:07 AM
Repeat data Sdbenn90 Excel Discussion (Misc queries) 6 December 24th 05 12:11 PM
Title Cut Off if Rows to Repeat & Columns to Repeat are Both Selec unibaby Excel Discussion (Misc queries) 2 August 24th 05 04:29 PM
Auto Repeat Data Mohd Rosdi Excel Worksheet Functions 2 July 31st 05 07:03 PM
Repeat Data Nagar Excel Programming 1 April 15th 05 02:57 AM


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