Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 ----- regards, driller |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "dribler" wrote: 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 ----- regards, driller |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mike,
thanks, it works to paste values only on the first row. any idea? "Mike H" wrote: 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 "dribler" wrote: 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 ----- regards, driller |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -- Don Guillett Microsoft MVP Excel SalesAid Software "dribler" wrote in message ... 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 ----- regards, driller |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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(2000 00000,L324:L8616,K324:K8616),K324:K8616)+1,1)),K32 4,INDEX(K324:K8616,MATCH(LOOKUP(200000000,L324:L86 16,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 "Don Guillett" wrote: 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 -- Don Guillett Microsoft MVP Excel SalesAid Software "dribler" wrote in message ... 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 ----- regards, driller |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Escape key won't work | Excel Discussion (Misc queries) | |||
Error handling and escape key | Excel Programming | |||
escape character | Excel Programming | |||
using escape key to exit a userform | Excel Programming | |||
How to escape this error message | Excel Programming |