Selecting all cells that contain a value AND the cell below it

ExcelEndeavor

New Member
Joined
Oct 13, 2020
Messages
11
Office Version
  1. 365
Platform
  1. MacOS
I am working with a list of our offices and some of them still show a fax number. I went to "Find and Select" to show all of the cells with the word "Fax" in them. How do I also select the corresponding fax numbers in the cell below them so I can delete all at once?

Thank you in advance.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Give us a sample worksheet using XL2BB (No pictures please). We can then write a program that is specific to your needs. 8-10 records that are representative of your actual file with dummy information.
 
Upvote 0
Give us a sample worksheet using XL2BB (No pictures please). We can then write a program that is specific to your needs. 8-10 records that are representative of your actual file with dummy information.
It is a simple sheet - everything is in Column A because I haven't sorted it out yet. I just want to get rid of the fax numbers and then I can start parsing.

Test.xlsx
A
1Office 1
2123 Main St
3This City, IA, 12345
4phone
5123-456-7890
6Office 2
7123 Main St
8This City, IA, 12345
9phone
10123-456-7890
11fax
12123-456-7890
13Office 3
14123 Main St
15This City, IA, 12345
16phone
17123-456-7890
18fax
19123-456-7890
20Office 4
21123 Main St
22This City, IA, 12345
23phone
24123-456-7890
25Office 5
26123 Main St
27This City, IA, 12345
28phone
29123-456-7890
30fax
31123-456-7890
32Office 6
33123 Main St
34This City, IA, 12345
35phone
36123-456-7890
37Office 7
38123 Main St
39This City, IA, 12345
40phone
41123-456-7890
42fax
43123-456-7890
44Office 8
45123 Main St
46This City, IA, 12345
47phone
48123-456-7890
49fax
50123-456-7890
51Office 9
52123 Main St
53This City, IA, 12345
54phone
55123-456-7890
56Office 10
57123 Main St
58This City, IA, 12345
59phone
60123-456-7890
61fax
62123-456-7890
Sheet1
 
Upvote 0
VBA Code:
Option Explicit

Sub Fax()
    Dim lr As Long, i As Long
    lr = Range("A" & Rows.Count).End(xlUp).Row
    For i = lr To 1 Step -1
        If Range("A" & i) = "fax" Then
            Range("A" & i + 1).Delete
            Range("A" & i).Delete
        End If
    Next i
    MsgBox "completed"
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,891
Messages
6,122,101
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top