Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LOOKUP skips cells reddog_3d[_2_] Excel Discussion (Misc queries) 6 November 30th 07 06:57 PM
Cells.Find method and Boolean operators Casey[_40_] Excel Programming 0 January 2nd 06 11:05 PM
Range.Find skips the first cell ?? Dave Peterson Excel Programming 1 July 15th 05 12:24 AM
Range.Find skips the first cell ?? Tim Williams Excel Programming 1 July 15th 05 12:22 AM
How select/define cells with FIND method (maybe together with SpecialCells) Marie J-son[_5_] Excel Programming 2 December 14th 04 03:49 PM


All times are GMT +1. The time now is 08:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"