+ Reply to Thread
Results 1 to 18 of 18

How to create sheets based on cell value

  1. #1
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    How to create sheets based on cell value

    Hello everyone

    I have the macro below that works well (with book1). The first section below needs to be updated, instead of looking at the values of column K and M, it should now just look at column J. If the value equals debit, then the amount should be placed in column E of the new sheet and if the value equals credit, then the amount should be placed in column F as it is in my example (book2). Thoughts? Ideas?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by AccountingJ; 06-12-2018 at 03:10 PM.

  2. #2
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to create sheets based on cell value

    or an if else statement, where if value in cell j2 equals debit then place value in column e, else f, I think that is a better explanation.

  3. #3
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to create sheets based on cell value

    All I have is:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: How to create sheets based on cell value


    Hi !

    Is it so difficult to attach a before workbook and an expected result workbook and crystal clear explain the need ?

  5. #5
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to create sheets based on cell value

    Book 2 has that, at least I think it does. Sheet1 is the data, and the two tabs are how it should look.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: How to create sheets based on cell value

    In book2 your last 4 rows are not clear. The value in col J does not match cols K & M

  7. #7
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to create sheets based on cell value

    Oh I see what you mean - okay here it goes.

    Sheet1 is the data that this database generates for different customers. Basically the macro needs to create a tab for the different accounts found in column "C" which it does. From there it should create headers in those new tabs, which again the macro I have does as well. Then the data (account, date, description and amount) in sheet1 needs to be transferred to the tab under its name. The macro already transfers over the account, date and description. The only thing I would like help with here is placing the amount in the appropriate column.

    For example, row 2, cell j2 says "Debit". Well then that amount should appear in in tab "123456" in column "E" under debit. As you can see, row 3, cell j3 says "Credit" so then that amount should be displayed in column "F".

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: How to create sheets based on cell value

    Do cols K & M still exist in your file? If so why change the macro?

  9. #9
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to create sheets based on cell value

    They do exist, there were a few changes.

    Column C which previously existed had account 123456 and either column K or M had account 123456. Well now column K or M read KLM000000123456 which throws off the macro on where to place the amount. I figure a way around it is to use a column that was just added with this change that identifies that amount as a debit or credit now found in column j.

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: How to create sheets based on cell value

    In that case can you please supply an accurate sample of what your data is like?

  11. #11
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to create sheets based on cell value

    Should have done that from the beginning. Here it is with the adjusted ranges in the macro. Book1 is the data that is provided, the tab named "987654" is what the macro should create.

    HTML Code: 
    Attached Files Attached Files

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: How to create sheets based on cell value

    Ok, how about
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to create sheets based on cell value

    Close, check out the attachment. For some reason all of the amounts are being brought over regardless if they occurred within that account.
    Attached Files Attached Files
    Last edited by AccountingJ; 06-12-2018 at 02:06 PM.

  14. #14
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: How to create sheets based on cell value

    How about
    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to create sheets based on cell value

    man you are gonna hate me - lol. It removes the additional amounts but there is an issue with the debits. The credits on the new tabs created are 100% right - but the debits are not. For example, account 987654 debit dated Feb. 03, 2018 has 101, on the new tab it has 102. It does that for all tabs. All credits add up but the debits do not.
    Attached Files Attached Files

  16. #16
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: How to create sheets based on cell value

    Oops, forgot to change this bit
    Please Login or Register  to view this content.

  17. #17
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to create sheets based on cell value

    Thank you very much! I do appreciate your time and patience.

  18. #18
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: How to create sheets based on cell value

    Glad to help & thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA to create sheets based on cell values
    By AccountingJ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-23-2018, 04:05 PM
  2. [SOLVED] Create sheets based on cell data
    By Spawn-Swe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-22-2016, 11:01 AM
  3. Create sheets based on cell data
    By Spawn-Swe in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 12-20-2016, 09:49 AM
  4. create sheets based on cell values with corresponding data
    By VinodN in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-29-2016, 07:16 AM
  5. [SOLVED] VBA: Create new sheets based on cell value and copy data
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2015, 07:33 PM
  6. [SOLVED] Create sheets based on Cell A name
    By Christopherdj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-05-2015, 04:24 AM
  7. [SOLVED] Filter data on sheet1, create, and paste into new sheets based on cell value
    By minister in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2013, 09:16 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1