Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
does anyone have code that after the value of a cell in a particular column
for the active row is changed, the row is deleted and appended to another worksheet in the workbook? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheet event code.
Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo stoppit Application.EnableEvents = False If Target.Address = "$A$1" And Target.Value < "" Then With Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp) .Offset(1, 0).EntireRow = Target.EntireRow.Value End With Target.EntireRow.Delete End If stoppit: Application.EnableEvents = True End Sub Gord Dibben MS Excel MVP On Tue, 16 Mar 2010 12:25:01 -0700, joemeshuggah wrote: does anyone have code that after the value of a cell in a particular column for the active row is changed, the row is deleted and appended to another worksheet in the workbook? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
this works quite nice...thanks! is there anyway to maintain the formatting
from the originating sheet? "Gord Dibben" wrote: Sheet event code. Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo stoppit Application.EnableEvents = False If Target.Address = "$A$1" And Target.Value < "" Then With Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp) .Offset(1, 0).EntireRow = Target.EntireRow.Value End With Target.EntireRow.Delete End If stoppit: Application.EnableEvents = True End Sub Gord Dibben MS Excel MVP On Tue, 16 Mar 2010 12:25:01 -0700, joemeshuggah wrote: does anyone have code that after the value of a cell in a particular column for the active row is changed, the row is deleted and appended to another worksheet in the workbook? . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, it can be done but I'm trying to visualize what you're doing.
If you copy the target row to Sheet2 with values and formats then delete the target row, your data and formats for that row are gone. The row that was below now becomes target row. Does it have data and formats also? Or maybe you just want original target row cleared of contents only, leaving a blank row with formats? Gord On Tue, 16 Mar 2010 17:06:10 -0700, joemeshuggah wrote: this works quite nice...thanks! is there anyway to maintain the formatting from the originating sheet? "Gord Dibben" wrote: Sheet event code. Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo stoppit Application.EnableEvents = False If Target.Address = "$A$1" And Target.Value < "" Then With Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp) .Offset(1, 0).EntireRow = Target.EntireRow.Value End With Target.EntireRow.Delete End If stoppit: Application.EnableEvents = True End Sub Gord Dibben MS Excel MVP On Tue, 16 Mar 2010 12:25:01 -0700, joemeshuggah wrote: does anyone have code that after the value of a cell in a particular column for the active row is changed, the row is deleted and appended to another worksheet in the workbook? . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i believe i figured out what i needed...
Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo stoppit Application.EnableEvents = False If Target.Column = 5 And Target.Row 2 And Target.Value < "" Then With Sheets("Account-Specfic Explanations").Cells(Rows.Count, "A").End(xlUp) .Offset(1, 0).EntireRow = Target.EntireRow.Value End With Target.EntireRow.Delete With Sheets("Account-Specfic Explanations").Cells(Rows.Count, "A").End(xlUp).Resize(1, 5).Borders .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Sheets("Account-Specfic Explanations").Cells(Rows.Count, "A").End(xlUp).Offset(0, 4).WrapText = True End With End If stoppit: Application.EnableEvents = True End Sub thanks! "Gord Dibben" wrote: Yes, it can be done but I'm trying to visualize what you're doing. If you copy the target row to Sheet2 with values and formats then delete the target row, your data and formats for that row are gone. The row that was below now becomes target row. Does it have data and formats also? Or maybe you just want original target row cleared of contents only, leaving a blank row with formats? Gord On Tue, 16 Mar 2010 17:06:10 -0700, joemeshuggah wrote: this works quite nice...thanks! is there anyway to maintain the formatting from the originating sheet? "Gord Dibben" wrote: Sheet event code. Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo stoppit Application.EnableEvents = False If Target.Address = "$A$1" And Target.Value < "" Then With Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp) .Offset(1, 0).EntireRow = Target.EntireRow.Value End With Target.EntireRow.Delete End If stoppit: Application.EnableEvents = True End Sub Gord Dibben MS Excel MVP On Tue, 16 Mar 2010 12:25:01 -0700, joemeshuggah wrote: does anyone have code that after the value of a cell in a particular column for the active row is changed, the row is deleted and appended to another worksheet in the workbook? . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating form on sheet 1 and having info move to sheet 2 | Excel Discussion (Misc queries) | |||
How do I move daily data from one sheet to a 'yearly sheet' | Excel Worksheet Functions | |||
Move data from sheet to sheet based on ColA | Excel Programming | |||
Move data to new sheet - rename sheet based on criteria ? | Excel Discussion (Misc queries) | |||
move rows of data seperated in a sheet to a sheet with no separat | Excel Worksheet Functions |