Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help in macro coding | Excel Discussion (Misc queries) | |||
Help on macro coding for URL | Excel Worksheet Functions | |||
Please help on coding the macro. | Excel Worksheet Functions | |||
HELP - coding on Macro! | Excel Worksheet Functions | |||
coding macro | Excel Discussion (Misc queries) |