![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | Blogs | Mark Forums Read |
| Microsoft Applications Discussions about Windows and other MS Products such as Office |
![]() |
| | LinkBack | Thread Tools |
| | #2 (permalink) |
| Civilians | Hi try something like: Sub Find_cell() Dim RowNdx As Long Dim LastRow As Long LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row For RowNdx = 1 to Lastrow with Cells(RowNdx, "A") if .interior.colorindex=24 then msgbox "found cell" .select exit sub End If end with Next RowNdx End Sub -- Regards Frank Kabel Frankfurt, Germany Jan wrote: > Hi > I want to create a macro that selects column "A:A", and then "finds" a > cell with colourindex 24. > When I try to record such a macro, there always seems to be an "error" > in the recorded macro. > Can anyone help ? |
|
| | #3 (permalink) |
| Civilians | Here's one way: Sub test3010() Dim iCell As Range For Each iCell In Range("A:A") If iCell.Interior.ColorIndex = 24 Then iCell.Select Exit For End If Next End Sub Alan Beban Jan wrote: > Hi > I want to create a macro that selects column "A:A", and then "finds" a > cell with colourindex 24. > When I try to record such a macro, there always seems to be an "error" > in the recorded macro. > Can anyone help ? |
|
| | #4 (permalink) |
| Civilians | Thanks !! It works! eyest@tiscali.be (Jan) wrote in message news:<ba7b2706.0404020640.a0aa923@posting.google.c om>... > Hi > I want to create a macro that selects column "A:A", and then "finds" a > cell with colourindex 24. > When I try to record such a macro, there always seems to be an "error" > in the recorded macro. > Can anyone help ? |
|
| | #5 (permalink) |
| Civilians | Hi Jan I wouldn't re-invent the wheel. As you must have Excel 2000 or higher, try Application.FindFormat.Interior.ColorIndex = 26 Columns(1).Find(What:="", After:=Cells(1, 1), _ LookIn:=xlValues, LookAt:=xlPart, _ SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=True).Activate End Sub ***** Posted via: http://www.ozgrid.com Excel Templates, Training & Add-ins. Free Excel Forum http://www.ozgrid.com/forum ***** |
|
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find God to Find One's True Self | Snowden | Prayer & Religious Discussion | 0 | 01-31-2008 10:10 |
| [MV] Can someone help me find............. | Chris Somers | MV List | 0 | 04-22-2006 00:28 |
| Re: Find all and Sum | Cutter | Microsoft Applications | 1 | 09-06-2005 12:00 |
| Just want to find out How does one become MVP. | =?Utf-8?B?QWpheSBLdW1hcg==?= | Microsoft Applications | 2 | 07-14-2004 15:55 |
| Help with: =RIGHT(A2,LEN(A2)-FIND(" ",A2)) | Stunners | Microsoft Applications | 6 | 06-16-2004 02:54 |
![]() | ![]() | ![]() |