Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't get the macro to continue through a range
I am having trouble with getting this to pass through the range of
"DataWithOnes". Not sure how to do this, can anyone see why? Thx in advance Sub Data_With_Ones() Set DataWithOnes = Range("E3:AU200") For Each c In DataWithOnes If c.Value 0 Then Cells.Find(What:="1", After:=ActiveCell, LookIn:=xlValues, LookAt:= _ xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase: = _ False, SearchFormat:=False).Activate Set topcell = ActiveCell Cells.Find(What:="2", After:=ActiveCell, LookIn:=xlValues, LookAt:= _ xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase: = _ False, SearchFormat:=False).Activate Set bottomcell = ActiveCell If topcell = 1 Then Set topcell = topcell Range(topcell, bottomcell).Select Selection.FillDown bottomcell.Select Else: End If Next End Sub -- Message posted via http://www.officekb.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't get the macro to continue through a range
Trouble in what way? It errors, doesn't do what you want?
What is it supposed to be doing? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Carrie_Loos via OfficeKB.com" <u34134@uwe wrote in message news:7ea8eeff31091@uwe... I am having trouble with getting this to pass through the range of "DataWithOnes". Not sure how to do this, can anyone see why? Thx in advance Sub Data_With_Ones() Set DataWithOnes = Range("E3:AU200") For Each c In DataWithOnes If c.Value 0 Then Cells.Find(What:="1", After:=ActiveCell, LookIn:=xlValues, LookAt:= _ xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase: = _ False, SearchFormat:=False).Activate Set topcell = ActiveCell Cells.Find(What:="2", After:=ActiveCell, LookIn:=xlValues, LookAt:= _ xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase: = _ False, SearchFormat:=False).Activate Set bottomcell = ActiveCell If topcell = 1 Then Set topcell = topcell Range(topcell, bottomcell).Select Selection.FillDown bottomcell.Select Else: End If Next End Sub -- Message posted via http://www.officekb.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't get the macro to continue through a range
It performs the macro outside of the range, I want to keep the macro in a
specific area and not find 1's and 2's in other parts of the worksheet. Bob Phillips wrote: Trouble in what way? It errors, doesn't do what you want? What is it supposed to be doing? I am having trouble with getting this to pass through the range of "DataWithOnes". Not sure how to do this, can anyone see why? [quoted text clipped - 34 lines] End Sub -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200801/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to scroll the worksheet and continue to run macro in backgro | Excel Programming | |||
How to continue macro if there is an error value | Excel Programming | |||
VB code to continue macro | Excel Discussion (Misc queries) | |||
VBA codes for macro to continue | Excel Programming | |||
The way to continue do macro recording | Excel Programming |