LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default search a row for data then move to next row


Hi,

Iwant to search 10 columns of data one row at a time (50 rows). If
the row contains the value "SL" then I want to add the value of the
first column of the current row to a variable. I've tried looping
through the entire range, but I then end up with duplicated data. I
need to move to the next row once the first instance of "SL" is found.

I have this so far (but it does not work

Sub test
Dim SickStaff As String
Dim d As Range

For Each d In ThisWorkbook.Sheets("AWD Grid").Range("G2:BB1000")
If d.Value = "SL" Then
SickStaff = SickStaff & Cells(d.Row, 1).Value & ", "
End If
Next d

End sub
Hope you can help.
 
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
Complex search, copy, and move opperation. Please HELP!!! Redoctober Excel Discussion (Misc queries) 3 September 9th 08 11:48 PM
Move names from Search to Excel Mark1 Excel Discussion (Misc queries) 5 October 27th 06 07:54 PM
Search and Move - Cannot Figure This Out - Please Help Paige Excel Programming 3 October 17th 06 03:42 PM
Search and move?? Robert M. Gary[_2_] Excel Programming 4 November 18th 05 12:47 PM
How do I move data based on a conditional column search? bbaek Excel Programming 1 May 27th 05 04:17 PM


All times are GMT +1. The time now is 04:08 AM.

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

About Us

"It's about Microsoft Excel"