• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

break-data-example VBA Macro

HilaryR

New Member
I used your break-data-example VBA macro to split my excel file into 380 separate files by manager name. Unfortunately, the copy portion is not working. I've debugged the macro - but it still doesn't seem to work. It works in the version I downloaded from Chandoo- but when I modify it to work in my own sheets, (it is VERY similar setup to sample file) the copy/paste does not work. It simply creates Blank workbooks.

Any help you can provide? Does it matter what version of excel I am using (Excel 2013)? See below for section of the VBA. At the ActiveSheet.Paste - it doesn't paste the data.

Code:
For Each cell In Range("lstSalesman")
        [valSalesman] = cell.Value
        Range("myList").AdvancedFilter Action:=xlFilterCopy, _
            criteriarange:=Range("Criteria"), copyToRange:=Range("Extract"), unique:=False
        Range(Range("Extract"), Range("Extract").End(xlDown)).Copy
        Workbooks.Add
        ActiveSheet.Paste
 
Last edited by a moderator:
your code seems incomplete - you only have the copy part in this thread so can't really tell what the real issue is. if I was to hazard a guess it might be that in your loop (I assume there is one) it is copying the data to new workbook but you could have missed to add a line to tell it to come back to original document before copying next data to new file. theres also no sample file attached here
 
Hello,

Can you please help to updated this macro to enable to creat excel sheets based on a range of dates instead. So for example to creat a sheet after the user write down two dates so the macro will pick everything in between and copy it to a new sheet and so on.
 
@Khaledalaydi please start new thread with your requirements instead of restarting old thread by another user. Please also add a sample file to your thread
 
Back
Top