+ Reply to Thread
Results 1 to 3 of 3

How to select entire rows which has values in column b

Hybrid View

  1. #1
    Registered User
    Join Date
    08-19-2015
    Location
    Patiala
    MS-Off Ver
    2007
    Posts
    6

    How to select entire rows which has values in column b

    I want to cut rows which have emails in them. How can I do this? i just want to take out those websites which have emails and I want to create separate file for those websites which dont have emails. How to do this?
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-18-2013
    Location
    Prague
    MS-Off Ver
    Excel 2013
    Posts
    161

    Re: How to select entire rows which has values in column b

    try this:

    Sub test()
    ' Find last row with fleet number
     LR = Sheets("Sheet1").Range("B" & Rows.Count).End(xlUp).Row
    ' Loops from last to first row
    For X = LR To 2 Step -1
    ' if value in column B is >0 or the cell is empty, it deletes the row
        	If Sheets("Sheet1").Range("B" & X) <> "" Or 0 Then	Rows(X).Delete Shift:=xlUp
    Next
    End Sub

  3. #3
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: How to select entire rows which has values in column b

    Or to have them in seperate sheet, in exemple sheet2

    Sub test()
    lr = Range("A" & Rows.Count).End(xlUp).Row
    Range("A1", "D" & lr).AutoFilter Field:=2, Criteria1:="="
    With Range("A1").CurrentRegion
        .Offset(1).Copy Sheets("sheet2").Range("A2")
        .Offset(1).Delete shift:=xlUp
    End With
    Range("A1", "D" & lr).AutoFilter
    End Sub
    Kind regards
    Leo
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 12
    Last Post: 09-16-2015, 12:35 PM
  2. How to select entire rows by specific column value?
    By gabrielemucho in forum Excel General
    Replies: 5
    Last Post: 09-09-2014, 08:06 AM
  3. [SOLVED] Select column C and delete blank entire rows Till C300
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2014, 08:55 AM
  4. [SOLVED] How to Select an entire table column for a Chart Series Values in VBA
    By MattTran in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2013, 03:37 PM
  5. Using Variables in Ranges to select entire rows or columns
    By BeefNoodleSoup in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2012, 12:37 AM
  6. [SOLVED] select entire rows using a contains comparison - an example
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-05-2006, 06:50 PM
  7. [SOLVED] Macro to select 4 entire rows and then delete rows
    By Scott Viney in forum Excel General
    Replies: 3
    Last Post: 09-22-2005, 03:05 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