Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Coding

I am needing some help on a coding issue in an Excel
Macro. I want the macro look for a value in a cell and
when it finds that value, I want it to delete that row.
Is this possible?

Also, are there any tips out there on how to code the
macro to start looking from the bottom up, instead of the
top down? I want to try to incorporate the macro to Auto
fill, but my data varies each time I import information.
If I auto fill the way I have it now, it will not auto
fill if I have more records.

Any help would be appreciated. Thanks and have a great
weekend!-----Julie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro Coding

Hi Julie

Example for column A

Sub DeleteRows()
findstring = "ron"
Set b = Range("A:A").find(What:=findstring, LookAt:=xlWhole)
While Not (b Is Nothing)
b.EntireRow.Delete
Set b = Range("A:A").find(What:=findstring, LookAt:=xlWhole)
Wend
End Sub

Example for looking from the bottom to the top

Dim a As Long
Dim i As Long
i = Cells(Rows.Count, "A").End(xlUp).Row
For a = i To 1 Step -1
If Cells(a, "A").Value = "ron" Then
Cells(a, "A").EntireRow.Delete
End If
Next a


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"JulieB" wrote in message ...
I am needing some help on a coding issue in an Excel
Macro. I want the macro look for a value in a cell and
when it finds that value, I want it to delete that row.
Is this possible?

Also, are there any tips out there on how to code the
macro to start looking from the bottom up, instead of the
top down? I want to try to incorporate the macro to Auto
fill, but my data varies each time I import information.
If I auto fill the way I have it now, it will not auto
fill if I have more records.

Any help would be appreciated. Thanks and have a great
weekend!-----Julie



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
Help in macro coding Sasikiran Excel Discussion (Misc queries) 3 March 24th 10 02:34 PM
Help on macro coding for URL Eric Excel Worksheet Functions 2 March 15th 08 02:02 PM
Please help on coding the macro. Eric Excel Worksheet Functions 0 March 11th 08 03:11 PM
HELP - coding on Macro! Eric Excel Worksheet Functions 3 February 21st 08 12:26 AM
coding macro Boss Excel Discussion (Misc queries) 0 November 13th 07 12:17 PM


All times are GMT +1. The time now is 11:55 PM.

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

About Us

"It's about Microsoft Excel"