Solved

move data to new sheets with same name

Posted on 2014-08-01
5
127 Views
Last Modified: 2014-08-01
from my active sheet I need to move data to a new sheet that has the same name as the name in column J [Ref]

so Rows go from A to S and I need all data from activesheet for CLOVC to be put on Sheet Named ClOVC, all data for BKIDQ to be put on sheet named BKIDQ etc etc

   Ref
CLOVC
CLOVC
CLOVC
BKIDQ
BKIDQ
CLOVC
SUUKG
MSSU0

Thanks in Advance.
0
Comment
Question by:Jagwarman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:Jagwarman
ID: 40233847
sorry aditional info, I need the header row from my active sheet to be included on each sheet.

Thanks
0
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40233856
Hi,

pls try

Sub macro()
Set OrigSh = ActiveSheet
For Each c In Range(Range("J2"), Range("J" & Rows.Count).End(xlUp))
    If c.Offset(0, -8) = Date Then
        On Error Resume Next
        Set Sh = Nothing
        Set Sh = ActiveWorkbook.Worksheets(c.Value)
        On Error GoTo 0
        If Sh Is Nothing Then
            ActiveWorkbook.Sheets.Add After:=Worksheets(Worksheets.Count)
            Worksheets(Worksheets.Count).Name = c.Value
            OrigSh.Range("A1").EntireRow.Copy ActiveWorkbook.Worksheets(c.Value).Range("A1")
        End If
        c.EntireRow.Copy ActiveWorkbook.Worksheets(c.Value).Range("A" & Rows.Count).End(xlUp).Offset(1)
    End If
Next

Open in new window

Regards
0
 

Author Comment

by:Jagwarman
ID: 40233885
its great except it did not put the header row in in left row 1 blank
0
 
LVL 52

Expert Comment

by:Rgonzo1971
ID: 40233888
My code copies Row 1 (EDIT not A) in the active sheet and copies it in the sheet but only if the sheet does not already exist
0
 

Author Comment

by:Jagwarman
ID: 40233919
My apologies that is brilliant. Thanks for all your help. Have a great weekend.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question