Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Cut and Paste entire row from one worksheet to another

Hello all,
I am attempting to cut and paste an entire row from a change action
from one worksheet to one named "Closed" with the current script:

Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Target.EntireRow.Cut
Closed.Paste
End If
End Sub

This works but after pasting the row, it throws an error saying target
does not equal anything essentially. Also, this script is embedded in
the worksheet.

Is there any way to fix this?

Any and all help is welcome!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Cut and Paste entire row from one worksheet to another

Tell excel to stop looking for changes:

Option Explicit
Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Application.EnableEvents = False
Target.EntireRow.Cut
Closed.Paste
Application.EnableEvents = True
End If
End Sub



wrote:

Hello all,
I am attempting to cut and paste an entire row from a change action
from one worksheet to one named "Closed" with the current script:

Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Target.EntireRow.Cut
Closed.Paste
End If
End Sub

This works but after pasting the row, it throws an error saying target
does not equal anything essentially. Also, this script is embedded in
the worksheet.

Is there any way to fix this?

Any and all help is welcome!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Cut and Paste entire row from one worksheet to another

Thank you for the help but I have a few more questions for anyone
willing.

How would I do these actions:
Paste to next empty row (the row after the last used one)
Delete/remove the row were the information came from?

Thank you for solving a seemingly simple issue I am having!

-- Chris
Dave Peterson wrote:
Tell excel to stop looking for changes:

Option Explicit
Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Application.EnableEvents = False
Target.EntireRow.Cut
Closed.Paste
Application.EnableEvents = True
End If
End Sub



wrote:

Hello all,
I am attempting to cut and paste an entire row from a change action
from one worksheet to one named "Closed" with the current script:

Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Target.EntireRow.Cut
Closed.Paste
End If
End Sub

This works but after pasting the row, it throws an error saying target
does not equal anything essentially. Also, this script is embedded in
the worksheet.

Is there any way to fix this?

Any and all help is welcome!


--

Dave Peterson


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Cut and Paste entire row from one worksheet to another

Here is what I now have, but it throws a 1004 error when trying to
select. Individually each work well. Any Suggestions?

Option Explicit
Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Application.EnableEvents = False
Target.EntireRow.Cut
FindLast2
'Closed.Paste
Application.EnableEvents = True
End If
End Sub

Public Sub FindLast2()
Closed.Range("A400").End(xlUp).EntireRow.Select
Selection.Insert Shift:=xlDown
End Sub

wrote:
Thank you for the help but I have a few more questions for anyone
willing.

How would I do these actions:
Paste to next empty row (the row after the last used one)
Delete/remove the row were the information came from?

Thank you for solving a seemingly simple issue I am having!

-- Chris
Dave Peterson wrote:
Tell excel to stop looking for changes:

Option Explicit
Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Application.EnableEvents = False
Target.EntireRow.Cut
Closed.Paste
Application.EnableEvents = True
End If
End Sub



wrote:

Hello all,
I am attempting to cut and paste an entire row from a change action
from one worksheet to one named "Closed" with the current script:

Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Target.EntireRow.Cut
Closed.Paste
End If
End Sub

This works but after pasting the row, it throws an error saying target
does not equal anything essentially. Also, this script is embedded in
the worksheet.

Is there any way to fix this?

Any and all help is welcome!


--

Dave Peterson


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Cut and Paste entire row from one worksheet to another

You can't select a range unless that sheet is active.

Maybe...(Untested):

Public Sub FindLast2()
Closed.Range("A400").End(xlUp).EntireRow.Insert Shift:=xlDown
End Sub





wrote:

Here is what I now have, but it throws a 1004 error when trying to
select. Individually each work well. Any Suggestions?

Option Explicit
Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Application.EnableEvents = False
Target.EntireRow.Cut
FindLast2
'Closed.Paste
Application.EnableEvents = True
End If
End Sub

Public Sub FindLast2()
Closed.Range("A400").End(xlUp).EntireRow.Select
Selection.Insert Shift:=xlDown
End Sub

wrote:
Thank you for the help but I have a few more questions for anyone
willing.

How would I do these actions:
Paste to next empty row (the row after the last used one)
Delete/remove the row were the information came from?

Thank you for solving a seemingly simple issue I am having!

-- Chris
Dave Peterson wrote:
Tell excel to stop looking for changes:

Option Explicit
Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Application.EnableEvents = False
Target.EntireRow.Cut
Closed.Paste
Application.EnableEvents = True
End If
End Sub



wrote:

Hello all,
I am attempting to cut and paste an entire row from a change action
from one worksheet to one named "Closed" with the current script:

Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Target.EntireRow.Cut
Closed.Paste
End If
End Sub

This works but after pasting the row, it throws an error saying target
does not equal anything essentially. Also, this script is embedded in
the worksheet.

Is there any way to fix this?

Any and all help is welcome!

--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Cut and Paste entire row from one worksheet to another

Thank you! Works great.

Dave Peterson wrote:
You can't select a range unless that sheet is active.

Maybe...(Untested):

Public Sub FindLast2()
Closed.Range("A400").End(xlUp).EntireRow.Insert Shift:=xlDown
End Sub





wrote:

Here is what I now have, but it throws a 1004 error when trying to
select. Individually each work well. Any Suggestions?

Option Explicit
Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Application.EnableEvents = False
Target.EntireRow.Cut
FindLast2
'Closed.Paste
Application.EnableEvents = True
End If
End Sub

Public Sub FindLast2()
Closed.Range("A400").End(xlUp).EntireRow.Select
Selection.Insert Shift:=xlDown
End Sub

wrote:
Thank you for the help but I have a few more questions for anyone
willing.

How would I do these actions:
Paste to next empty row (the row after the last used one)
Delete/remove the row were the information came from?

Thank you for solving a seemingly simple issue I am having!

-- Chris
Dave Peterson wrote:
Tell excel to stop looking for changes:

Option Explicit
Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Application.EnableEvents = False
Target.EntireRow.Cut
Closed.Paste
Application.EnableEvents = True
End If
End Sub



wrote:

Hello all,
I am attempting to cut and paste an entire row from a change action
from one worksheet to one named "Closed" with the current script:

Public Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value = "Complete" Then
Target.EntireRow.Cut
Closed.Paste
End If
End Sub

This works but after pasting the row, it throws an error saying target
does not equal anything essentially. Also, this script is embedded in
the worksheet.

Is there any way to fix this?

Any and all help is welcome!

--

Dave Peterson


--

Dave Peterson


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



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