Hi Guys,
Need a little bit of help. I've got a workbook with various worksheets in it.
One of the worksheets contains all of the data and the rest are empty.
What I need to do is move entire rows of from the main worksheet in to worksheets named the same as the value in column C of the row.
for example one row may have TEST in column C so i want to move it to the worksheet called TEST. The next row might have TESTING in column C so that would go to the worksheet called TESTING. and so on.
thanks in advance!
Last edited by mattmac; 07-07-2009 at 06:22 AM.
Hi
try the attached macro
Ravi
Just what I was looking for. Thank you!
I've made the following code:Sub CopyPaste() Dim Ccell As Range Dim Ws As Worksheet Dim RowCounter() As Long ReDim RowCounter(Sheets.Count) For Each Ws In Worksheets RowCounter(Ws.Index) = 1 For Each Ccell In Range("Sheetname") 'Sheetname defined in Excel names If Ws.Name = Ccell.Value Then Ccell.EntireRow.Copy ActiveSheet.Paste Destination:=Sheets(Ws.Name).Cells(RowCounter(Ws.Index), 1) RowCounter(Ws.Index) = RowCounter(Ws.Index) + 1 End If Next Next End Sub
Looking for great solutions but hate waiting?
Seach this Forum through Google
www.Google.com (e.g. +multiple +IF site:excelforum.com/excel-general/ )
www.Google.com (e.g. +fill +combobox site:excelforum.com/excel-programming/ )
Ave,
Ricardo
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks