Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Delete Rows in VB

I need to create a macro that will search through all customer numbers in a
particular column, and delete the rows that contain customer numbers that
start with a numeral. The customer numbers that start with a letter are the
ones I need. How can I make this happen? I was thinking along the lines of
Find and Replace, but can't figure it out. Can someone help me? Thanks!

Ryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Delete Rows in VB

This might be a silly question, but why not just sort the sheet, which will
float the numerals to the top or bottom and then just delete them from there?
It is manual but easy...

"Neutron1871" wrote:

I need to create a macro that will search through all customer numbers in a
particular column, and delete the rows that contain customer numbers that
start with a numeral. The customer numbers that start with a letter are the
ones I need. How can I make this happen? I was thinking along the lines of
Find and Replace, but can't figure it out. Can someone help me? Thanks!

Ryan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete Rows in VB

Try this on a backup copy of your data

It assumes account number in column A





Sub DelRecords()
Dim lRow As Long

For lRow = Cells(Rows.Count, "a").End(xlUp).Row _
To 1 Step -1
Select Case Left(Cells(lRow, "a"), 1)
Case 0 To 9
Rows(lRow).Delete
End Select
Next lRow
End Sub






"?B?SmltIFRob21saW5zb24=?=" wrote in message ...
This might be a silly question, but why not just sort the sheet, which will
float the numerals to the top or bottom and then just delete them from there?
It is manual but easy...

"Neutron1871" wrote:

I need to create a macro that will search through all customer numbers in a
particular column, and delete the rows that contain customer numbers that
start with a numeral. The customer numbers that start with a letter are the
ones I need. How can I make this happen? I was thinking along the lines of
Find and Replace, but can't figure it out. Can someone help me? Thanks!

Ryan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Delete Rows in VB

It works. Thank you so much!!!

"Mudraker" wrote:

Try this on a backup copy of your data

It assumes account number in column A





Sub DelRecords()
Dim lRow As Long

For lRow = Cells(Rows.Count, "a").End(xlUp).Row _
To 1 Step -1
Select Case Left(Cells(lRow, "a"), 1)
Case 0 To 9
Rows(lRow).Delete
End Select
Next lRow
End Sub






"?B?SmltIFRob21saW5zb24=?=" wrote in message ...
This might be a silly question, but why not just sort the sheet, which will
float the numerals to the top or bottom and then just delete them from there?
It is manual but easy...

"Neutron1871" wrote:

I need to create a macro that will search through all customer numbers in a
particular column, and delete the rows that contain customer numbers that
start with a numeral. The customer numbers that start with a letter are the
ones I need. How can I make this happen? I was thinking along the lines of
Find and Replace, but can't figure it out. Can someone help me? Thanks!

Ryan


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 03:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"