Results 1 to 9 of 9

Loop through Column B for Specific value

Threaded View

GFOREMAN Loop through Column B for... 01-10-2014, 04:37 PM
GFOREMAN Re: help with code 01-10-2014, 04:42 PM
alansidman Re: help with code 01-10-2014, 04:58 PM
GFOREMAN Re: Need Help editing code 01-10-2014, 05:20 PM
alansidman Re: Need Help editing code 01-10-2014, 05:31 PM
FDibbins Re: Loop through Column B for... 01-10-2014, 05:36 PM
gsnidow Re: Loop through Column B for... 01-10-2014, 06:09 PM
GFOREMAN Re: Loop through Column B for... 01-10-2014, 06:27 PM
gsnidow Re: Loop through Column B for... 01-10-2014, 08:42 PM
  1. #1
    Registered User
    Join Date
    01-10-2014
    Location
    florida
    MS-Off Ver
    Excel 2010
    Posts
    8

    Loop through Column B for Specific value

    please help me edit this code to pertain to my file, essentially this should do what i want just needs to be formated for my file.

    i need the file to look through all of column "B" find the cells that have "PA" displayed in column B and then copy that rows data to a new sheet. if possible for all tabs in file one for each day of the year.

    thank you in advance.

    Sub FIND_TEST3()
    Dim n1 As String
    Dim Wks As Worksheet
    Dim c As Range
    Dim firstAddress As String
    Dim DestCell As Range
    
    Set Wks = Worksheets("IRS Commission")
    n1 = Sheets("Employee Data Entry").Range("D2").Value
    
    With Wks
    With .Range("I1").EntireColumn
        Set c = .Cells.find(What:=n1, _
        after:=.Cells(.Cells.Count), _
        LookIn:=xlValues, _
        LookAt:=xlWhole, _
        SearchOrder:=xlByRows, _
        SearchDirection:=xlNext, _
        MatchCase:=False)
        
        If Not c Is Nothing Then
            firstAddress = c.Address
            Do
                With Worksheets(n1)
                    Set DestCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
                End With
                c.EntireRow.Copy _
                Destination:=DestCell
                Set c = .FindNext(c)
                            
            Loop While Not c Is Nothing And c.Address <> firstAddress
        End If
    End With
    End With
    End Sub
    Last edited by GFOREMAN; 01-10-2014 at 07:26 PM. Reason: code tags added

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. loop continue till last invoice (srv) no. in specific column.
    By amarjeet.it in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-01-2013, 03:58 PM
  2. Replies: 2
    Last Post: 11-28-2013, 03:13 PM
  3. Loop to search specific names in column and delete other rows
    By EJ_2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2013, 01:28 PM
  4. [SOLVED] Cycle through each row in Column A in a for loop for specific text?
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2013, 03:47 PM
  5. Loop Until Active Cell is in a specific column?
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2013, 02:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1