Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default copy rows to multiple sheets

Welcome. Try the below

Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.


Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastExitRow As Long, ws As Worksheet
If Target.Column = 17 And Target.Text < "" Then
On Error Resume Next
Set ws = Worksheets(Target.Text)
On Error GoTo 0
If Not ws Is Nothing Then
With Worksheets(Target.Text)
Application.EnableEvents = False
LastExitRow = .Cells(Rows.Count, "A").End(xlUp).Row
Target.EntireRow.Copy .Range("A" & LastExitRow + 1)
Target.EntireRow.Delete
Application.EnableEvents = True
End With
End If
End If

End Sub

--
Jacob


"pvkutty" wrote:

I got this macro from you disc table . My question is can I add diff
worksheet with diff names and add correspondng rows to that sheet.
exp. I have EXIT, ALH,EASY three sheets and I need that corresponding
rows to copy to these sheets when I etner Q column.


Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastExitRow As Long, Cell As Range
For Each Cell In Target
If Cell.Column = 17 Then ' 17 = Column Q
If UCase(Cell.Value) = "EXIT" Then
With Worksheets("EXIT")
LastExitRow = .Cells(Rows.Count, "A").End(xlUp).Row
Cell.EntireRow.Copy .Cells(LastExitRow - (.Cells( _
LastExitRow, "A").Value < ""), "A")
Cell.EntireRow.Delete
End With
End If
End If
Next
End Sub


--
pvkkutty new to discussion group however a freequent reader of discussion
group posts

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
Copy all Rows from Several Sheets to 1 Sheet At Once KennyD Excel Discussion (Misc queries) 1 January 28th 10 04:56 AM
Copy rows between different sheets if condition met AUCP03 Excel Worksheet Functions 5 March 13th 09 01:45 PM
Copy data to multiple sheets HighlandRoss Excel Worksheet Functions 2 February 27th 08 08:38 PM
Copy date formula to multiple sheets John Excel Discussion (Misc queries) 2 November 22nd 06 10:36 PM
Copy rows of one sheet into mutiple sheets based on column value Wesley Breshears Excel Discussion (Misc queries) 0 October 18th 06 03:19 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"