Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find method skips over cells
This code works nine times and then skips Sept, Nov, and Dec I beleive this has something to do with merged cells, because those three months are merged cells, however it it works on March which is also a merged cell also merged cells. Hydra For MonthCounter = 1 To 12 Cells.Find(What:="$", After:=ActiveCell, LookIn:= _ xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False).Activate PriceAddress(Monthcounter) = ActiveCell.Address Next Monthcounter |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find method skips over cells
I'm not sure exactly what you are trying to accomplish, but you can try this.
Sub MonthCounter() Dim MonthCounter As Long For MonthCounter = 1 To 12 Cells.Find(What:="$", _ After:=ActiveCell, _ LookIn:=xlValues, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False).Select PriceAddress(MonthCounter) = Selection.Address Next MonthCounter End Sub If this doesn't work you will have to be more specific on what you want? Are you getting an error thrown? What is PriceAddress? Is it a Function or Sub that returns something? Please be more specific. Hope this helps! If so, please click "YES" below. -- Cheers, Ryan "Hydra" wrote: This code works nine times and then skips Sept, Nov, and Dec I beleive this has something to do with merged cells, because those three months are merged cells, however it it works on March which is also a merged cell also merged cells. Hydra For MonthCounter = 1 To 12 Cells.Find(What:="$", After:=ActiveCell, LookIn:= _ xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False).Activate PriceAddress(Monthcounter) = ActiveCell.Address Next Monthcounter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
LOOKUP skips cells | Excel Discussion (Misc queries) | |||
Cells.Find method and Boolean operators | Excel Programming | |||
Range.Find skips the first cell ?? | Excel Programming | |||
Range.Find skips the first cell ?? | Excel Programming | |||
How select/define cells with FIND method (maybe together with SpecialCells) | Excel Programming |