C
Carrie_Loos via OfficeKB.com
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
"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