ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to find data and select from active cell to the last row (https://www.excelbanter.com/excel-programming/351350-macro-find-data-select-active-cell-last-row.html)

Lost in Alabama

macro to find data and select from active cell to the last row
 
I need help creating a macro to find "ZZZZZCount" in column J, then select
the Rows from the cell just found to the end of the sheet (R65000) and
delete. The cell location of "ZZZZZCount" will not be constant.

Thanks,


F G H J
Task Code Task ID Sub No. STSLN
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 330 CIAA
100 ZZZZZCount
100 ZZZZZCount
100 ZZZZZCount
100 ZZZZZCount



Tom Ogilvy

macro to find data and select from active cell to the last row
 
Dim rng as Range, rng1 as Range
set rng = columns(10).find("ZZZZZCount", After:=Range("J1"), _
Lookat:=xlPart)
if not rng is nothing then
set rng1 = Range(rng,cells(rows.count,"J")).EntireRow
rng1.Delete
end if

--
Regards,
Tom Ogilvy


"Lost in Alabama" wrote in message
...
I need help creating a macro to find "ZZZZZCount" in column J, then select
the Rows from the cell just found to the end of the sheet (R65000) and
delete. The cell location of "ZZZZZCount" will not be constant.

Thanks,


F G H J
Task Code Task ID Sub No. STSLN
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 330 CIAA
100 ZZZZZCount
100 ZZZZZCount
100 ZZZZZCount
100 ZZZZZCount





Lost in Alabama

macro to find data and select from active cell to the last row
 
Thank you so much for your speedy response...I'll give it a try.



"Tom Ogilvy" wrote:

Dim rng as Range, rng1 as Range
set rng = columns(10).find("ZZZZZCount", After:=Range("J1"), _
Lookat:=xlPart)
if not rng is nothing then
set rng1 = Range(rng,cells(rows.count,"J")).EntireRow
rng1.Delete
end if

--
Regards,
Tom Ogilvy


"Lost in Alabama" wrote in message
...
I need help creating a macro to find "ZZZZZCount" in column J, then select
the Rows from the cell just found to the end of the sheet (R65000) and
delete. The cell location of "ZZZZZCount" will not be constant.

Thanks,


F G H J
Task Code Task ID Sub No. STSLN
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 320 CHAA
JGDAAAA REPAIR AVENGER COMPOSITE PANEL 330 CIAA
100 ZZZZZCount
100 ZZZZZCount
100 ZZZZZCount
100 ZZZZZCount







All times are GMT +1. The time now is 07:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com