ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Rows and Sheets (https://www.excelbanter.com/excel-worksheet-functions/208474-rows-sheets.html)

VegasBurger

Rows and Sheets
 
Is it possible to create something in Excel that will take information on one
row and move that information to another row on another sheet in the same
workbook?

I have a workbook for sales leads that I would like to have the option to
move a dead lead off the active sheet onto a completely different sheet. It
would clear the row of the now dead lead and continue to the list on the
other sheet as more and more leads become inactive.

Is that even possible?

The Code Cage Team[_8_]

Rows and Sheets
 

assuming you have data in column A and that your "Dead" marker is in
column L, this code will move all rows that have the word "Dead" in
column L to sheet 2 next available row and then delete the original row
and move the data up!

Sub Move_Dead()
Dim Rng As Range, MyCell As Range
Set Rng = ActiveSheet.Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)
For Each MyCell In Rng
If MyCell.Offset(0, 11) = "Dead" Then
MyCell.EntireRow.Copy Destination:= _
Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
MyCell.EntireRow.Delete shift:=xlUp
End If
Next MyCell
End Sub


--
The Code Cage Team

Regards,
The Code Cage Team
www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=23451



All times are GMT +1. The time now is 09:10 PM.

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