Author Topic: N00b Excel Q  (Read 803 times)

0 Members and 1 Guest are viewing this topic.

GilloD

  • TAKE THE LIFE OF FRED ASTAIRE. MAKE HIM PAY. TRANSFER HIS FAME TO YOU.
  • Senior Member
N00b Excel Q
« on: September 24, 2008, 05:15:15 PM »
I've got a mailing list of 25k names. In every row there are 6 pieces of data- Customer #, First, Last, E-mail, Format Pref and Status. For every ROW whose STATUS is "Unsubscribed", I need to DELETE that row.

How do I do this? I've been able to Find+Replace a CELL, but not a ROW.
wha

ananus

  • Member
Re: N00b Excel Q
« Reply #1 on: September 24, 2008, 05:33:04 PM »
ctrl + f > replace tab > put the text in it and then in the replace text field leave it blank. click to replace all.

edit: if the shortcut isn't ctrl + f use edit > find
« Last Edit: September 24, 2008, 05:34:58 PM by ananus »

GilloD

  • TAKE THE LIFE OF FRED ASTAIRE. MAKE HIM PAY. TRANSFER HIS FAME TO YOU.
  • Senior Member
Re: N00b Excel Q
« Reply #2 on: September 24, 2008, 05:34:44 PM »
ctrl + f > replace tab > put the text in it and then in the replace text field leave it blank. click to replace all.

Yeah, but this just replaces the individual CELLS, I need to wipe the whole ROW that cell is in
wha

ananus

  • Member
Re: N00b Excel Q
« Reply #3 on: September 24, 2008, 05:37:50 PM »
ah, i dunno then.

ananus

  • Member
Re: N00b Excel Q
« Reply #4 on: September 24, 2008, 06:12:39 PM »
tools > macro > macros... > create a new macro. paste this:

Code: [Select]
    rowx = 1
    Do Until Cells(rowx + 1, COLUMN.Value = ""
        If UCase(Right(Cells(rowx, COLUMN).Value, 12)) = "UNSUBSCRIBED" Then
            Cells(rowx, COLUMN).EntireRow.Delete
        Else
            rowx = rowx + 1
        End If
    Loop

where it says COLUMN you have to put the column where unsubscribed is, starting from 1. then execute the macro.

Bocsius

  • is calmer than you are
  • Senior Member
Re: N00b Excel Q
« Reply #5 on: September 24, 2008, 06:15:28 PM »
Try a macro.

Code: [Select]
Sub TryThis()

    Range("A1").Select
    Dim bCont As Boolean
    bCont = True
   
    Dim iRow As Integer
       
    Do
   
        iRow = 1
   
        If (LCase(ActiveCell.Offset(0, 5).Range("A1").Value) = "unsubscribed") Then
            Rows(ActiveCell.Row).Delete
            iRow = 0
        End If
       
        ActiveCell.Offset(iRow, 0).Range("A1").Select
       
        If ActiveCell.Value = "" Then
            bCont = False
        End If
   
    Loop Until Not bCont

End Sub

Edit: late, as per the usual.

pilonv1

  • I love you just the way I am
  • Senior Member
Re: N00b Excel Q
« Reply #6 on: September 24, 2008, 08:38:14 PM »
couldnt you just auto filter for unsubscribed and delete whatever shows up?
itm

Reb

  • Hon. Mr. Tired
  • Senior Member
Re: N00b Excel Q
« Reply #7 on: September 25, 2008, 01:58:05 AM »
I rule autofilter as the winning idea.
brb

Reb

  • Hon. Mr. Tired
  • Senior Member
Re: N00b Excel Q
« Reply #8 on: September 25, 2008, 02:00:36 AM »
Also, you can sort by that column, so you have all the Unsucribed rows toghether for the deleting.
brb

pilonv1

  • I love you just the way I am
  • Senior Member
Re: N00b Excel Q
« Reply #9 on: September 25, 2008, 04:18:04 AM »
exactly. no need for macro for simple deletion

smh
itm

Bildi

  • AKA Bildo
  • Senior Member
Re: N00b Excel Q
« Reply #10 on: September 25, 2008, 04:28:50 AM »
Also, you can sort by that column, so you have all the Unsucribed rows toghether for the deleting.


Yeah, that's what I was going to suggest.  If you'll have trouble sorting after you've deleted some rows, add a column with numbers before you do anything, then sort by that column after deleting the unwanted rows.

Reb

  • Hon. Mr. Tired
  • Senior Member
Re: N00b Excel Q
« Reply #11 on: September 25, 2008, 07:04:32 AM »
Stupid IT homos.
brb

Bocsius

  • is calmer than you are
  • Senior Member
Re: N00b Excel Q
« Reply #12 on: September 25, 2008, 09:12:08 AM »
You guys are simply fixing the problem. We were killing it with fire. :(

CajoleJuice

  • kill me
  • Icon
Re: N00b Excel Q
« Reply #13 on: September 25, 2008, 10:24:19 AM »
smh noobs

working with excel all day :-\
AMC