|
-
Jul 17th, 2009, 05:44 AM
#1
Thread Starter
Fanatic Member
Deletion of rows in excel
Hi
I was hoping someone could help me out here please, basically I have rows and rows of data in Excel, in column H some cells start with __INVALID - so would it be possible to run a macro which would delete the whole row? So basically search and delete all rows where column c = __INVALID.
Thanks
Please mark threads as resolved once the problem has been solved.
I apprecaite all your help/advice given 
-
Jul 17th, 2009, 01:22 PM
#2
Re: Deletion of rows in excel
vb Code:
Sub FindText() Dim rng1 As Range, cell As Range, SrchString As String Application.ScreenUpdating = False '~~> Change this to the relevant Column Set rng1 = Range("A:A") SrchString = "__INVALID" For Each cell In rng1 '~~> I am searching for words starting with "__INVALID" '~~> Change this as per your requirememnt. For example '~~> If you want to check for "__INVALID" at any position '~~> in the cell then use Instr() If UCase(Left(Trim(cell.Value), 9)) = SrchString Then '~~> Delete Row Rows(cell.Row).Delete Shift:=xlUp End If Next Application.ScreenUpdating = True End Sub
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|