Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default 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
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
VBA Code - Find & Move Youlan Excel Discussion (Misc queries) 19 May 13th 08 11:42 PM
VBA Code to move DataLables to top of Chart Frank Hayes Charts and Charting in Excel 4 October 13th 07 02:15 PM
Code to Move Several Lines to Master Worksheet MGC Excel Discussion (Misc queries) 5 August 18th 07 01:48 PM
Code to find code D. Excel Discussion (Misc queries) 2 August 12th 07 06:16 PM
Pivot Table VBA code to move a row uclawarren Excel Discussion (Misc queries) 0 October 10th 05 08:49 PM


All times are GMT +1. The time now is 11:41 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"