do until blank

S

s_smith_iet

Hey

I need some code for the following:

I have a work book A.xls sheet B
I need to find the last non blank cell in column A and then cut that
row into work book C.xls sheet D
Then I need to loop through this until Column A in workbook A.xls
sheet B is empty

Should be easy but I have not clue how to do this

Please help
 
M

MarkS

Try this

iCounter = 1
do until Range("A" & iCounter).value = ""
iCounter = iCounter + 1
loop

iCounter wil now have the tow number of the first blank cell
 
S

s_smith_iet

Not working for me

Please look at code and tell me why I cant do this....

Thanks

Workbooks("P124.xls").Activate
Sheets("Copy of Cycles with problems").Select

icounter = 1
Do Until Range("A" & icounter).Value = ""
icounter = icounter + 1
icounter.Offset(0, -1).Select
ActiveCell.Offset(0, 0).Resize(1, 108).Cut
Workbooks("P124 Datalog trending.xls").Activate
Sheets("Cycles with no problems ").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Rows("2:2").Select
Selection.Insert Shift:=xlDown
Workbooks("P124.xls").Activate
Sheets("Copy of Cycles with problems").Select
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top