a few adjustment for a do-loop escape

D

dribler

i need to place a criteria to enable the macro from stop its execution
if J324=0, then end
----
Sub filldown()
Do
If Range("J324").Formula > 0 Then
Range("J324").Copy
Range("C88").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("E225:E263").Copy
Range("l8500").End(xlUp).Offset(1, 0).PasteSpecial
Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
End If
Loop
End Sub
 
M

Mike H

Hi,

You don't need a do loop, try this

Sub filldown()
If Range("J324").Formula > 0 Then
Range("J324").Copy
Range("C88").PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Range("E225:E263").Copy
Range("l8500").End(xlUp).Offset(1, 0).PasteSpecial _
Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=True
End If
End Sub

Mike
 
D

Don Guillett

This seems a bit much. Tell us what you have and what you want to do. What
does j324 have to do with it. And, also range c88?

One efficiency below
if range("j324")>0 then range("c88").value=range("j324").value
 
D

dribler

Don,

J324 is the search formula to obtain the DATA along Column K which is
adjacent to the first un-filled row of L324:AX8616.

J324=IF(ISERROR(INDEX(K324:K8616,MATCH(LOOKUP(200000000,L324:L8616,K324:K8616),K324:K8616)+1,1)),K324,INDEX(K324:K8616,MATCH(LOOKUP(200000000,L324:L8616,K324:K8616),K324:K8616)+1,1))

C88 is a data cell *as calculator* for the formulated cells e225:e263
One efficiency below
if range("j324")>0 then range("c88").value=range("j324").value

Per your efficiency advise, there appears a compile error "End If without
block If" on adjustment below.
----------
Do
If range("j324")>0 then range("c88").value=range("j324").value
Range("E225:E263").Copy
Range("l10000").End(xlUp).Offset(1, 0).PasteSpecial
Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
End If
Loop
End Sub
-------------

The first macro i presented below works yet it will only stop with "Esc".
Problem is i cant see if the rows are completely filled-in when i fully stop
macro exec.
As the subject says, I need to have the "Escape" line on the macro which i
have no any idea where to start.

thanks for your effort and pls advise if you have any more ideas.

regards,
driller
 

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