Consulting

Results 1 to 5 of 5

Thread: Solved: Trim the fat

  1. #1
    VBAX Mentor
    Joined
    Sep 2004
    Posts
    431
    Location

    Solved: Trim the fat

    Hello, I tried to "trim the fat" from this code to no avail.
    Keeping in mind that there is no need to filter the data as column A will always be a unique number AND that there are no headers ,what parts of the code can be deleted and still have a new sheet created for each row of the active sheet (without headers as in S1 when code is run)?

    Thank you
    Thank you for your help

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    How about
    [VBA]
    Sub MakeSheets()
    Dim cel As Range, sh As Worksheet
    For Each cel In Range("Sheet1!A:A")
    If cel = "" Then Exit Sub
    Set sh = Sheets.Add
    sh.Name = cel
    Next
    End Sub

    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Mentor
    Joined
    Sep 2004
    Posts
    431
    Location
    Sorry for the delay, my wife took me for a walk.
    Thank you for the simplified code mdmackillop can you further help so that each new sheet would pickup the data of the corresponding row?
    Many thanks
    Nick
    Thank you for your help

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [VBA] sh.Name = cel
    sh.Rows("1:1").Value = cel.EntireRow.Value
    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    VBAX Mentor
    Joined
    Sep 2004
    Posts
    431
    Location

    Red face

    Yes it is perfect now.
    Thank you for your help,
    Nick
    I'll mark it "solved" as soon as I find the darn button
    Thank you for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •