Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA Code - Find & Move
Hi,
I'm using Excel 2002 and I need a code that can perform the following operation: 1) Find text "REPO" 2) Once found, Move to the cell directly below it (-1, r) 3) Delete Entire Row where text was originally (+ ,r ) Thanks in advance |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA Code - Find & Move
Youlan,
Sub TryNow() Dim myC As Range Set myC = Cells.Find("REPO") myC(2).Select myC.EntireRow.Delete End Sub HTH, Bernie MS Excel MVP "Youlan" wrote in message ... Hi, I'm using Excel 2002 and I need a code that can perform the following operation: 1) Find text "REPO" 2) Once found, Move to the cell directly below it (-1, r) 3) Delete Entire Row where text was originally (+ ,r ) Thanks in advance |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA Code - Find & Move
Hi
Thanks for your response but I would also need to select the cell with "REPO" once found and move it to cell directly below and then delete the row where "REPO" was originally. Can you help me with that please? Regards, "Bernie Deitrick" wrote: Youlan, Sub TryNow() Dim myC As Range Set myC = Cells.Find("REPO") myC(2).Select myC.EntireRow.Delete End Sub HTH, Bernie MS Excel MVP "Youlan" wrote in message ... Hi, I'm using Excel 2002 and I need a code that can perform the following operation: 1) Find text "REPO" 2) Once found, Move to the cell directly below it (-1, r) 3) Delete Entire Row where text was originally (+ ,r ) Thanks in advance |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA Code - Find & Move
Sorry - I read your move as move to the next cell, not move the cell to the next row.
Sub TryNow2() Dim myC As Range Dim myR As Long Set myC = Cells.Find("REPO") myR = myC.Row myC.Cut myC(2) Cells(myR, 1).EntireRow.Delete End Sub HTH, Bernie MS Excel MVP "Youlan" wrote in message ... Hi Thanks for your response but I would also need to select the cell with "REPO" once found and move it to cell directly below and then delete the row where "REPO" was originally. Can you help me with that please? Regards, "Bernie Deitrick" wrote: Youlan, Sub TryNow() Dim myC As Range Set myC = Cells.Find("REPO") myC(2).Select myC.EntireRow.Delete End Sub HTH, Bernie MS Excel MVP "Youlan" wrote in message ... Hi, I'm using Excel 2002 and I need a code that can perform the following operation: 1) Find text "REPO" 2) Once found, Move to the cell directly below it (-1, r) 3) Delete Entire Row where text was originally (+ ,r ) Thanks in advance |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA Code - Find & Move
Thats perfect...thanks a million
"Bernie Deitrick" wrote: Sorry - I read your move as move to the next cell, not move the cell to the next row. Sub TryNow2() Dim myC As Range Dim myR As Long Set myC = Cells.Find("REPO") myR = myC.Row myC.Cut myC(2) Cells(myR, 1).EntireRow.Delete End Sub HTH, Bernie MS Excel MVP "Youlan" wrote in message ... Hi Thanks for your response but I would also need to select the cell with "REPO" once found and move it to cell directly below and then delete the row where "REPO" was originally. Can you help me with that please? Regards, "Bernie Deitrick" wrote: Youlan, Sub TryNow() Dim myC As Range Set myC = Cells.Find("REPO") myC(2).Select myC.EntireRow.Delete End Sub HTH, Bernie MS Excel MVP "Youlan" wrote in message ... Hi, I'm using Excel 2002 and I need a code that can perform the following operation: 1) Find text "REPO" 2) Once found, Move to the cell directly below it (-1, r) 3) Delete Entire Row where text was originally (+ ,r ) Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA Code - Find & Move | Excel Discussion (Misc queries) | |||
VBA Code to move DataLables to top of Chart | Charts and Charting in Excel | |||
Code to Move Several Lines to Master Worksheet | Excel Discussion (Misc queries) | |||
Code to find code | Excel Discussion (Misc queries) | |||
Pivot Table VBA code to move a row | Excel Discussion (Misc queries) |