+ Reply to Thread
Results 1 to 20 of 20

VB Code or formula to reorganize data

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code or formula to reorganize data

    Hello:

    Please refer to attached file.
    I have bank statemment data as shown in column A thru G
    Column D is expense, column E is Income.
    I need either VB Code or formula to put this data per date as in column I.
    Example:
    I will have description entered in cell J1:Q1 for Income (Column E).
    I see 3 deposit on 10/2/2017 for 745,762 and 833.
    So these deposits need to go in cell J3,K3 and L3 as description is in cell J1:N1.
    Same way need to see the TEXT in J1:Q1 and enter in per date.
    Same way need to see the TEXT in T1:U1 and enter in per date for expense.

    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: VB Code or formula to reorganize data

    I wont be solving this but your output table implies there will never be more than 5 deposits per day (since you only have 5 columns for deposits (J-N).
    Is that correct, will there never be more than 5 deposits per day?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code or formula to reorganize data

    Hello:

    Good question, may be i can extend to 10 deposits per day...as per attached.
    Please let me know if you have any questions.
    Thanks.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: VB Code or formula to reorganize data

    Three different formulae, as shown in the attached, variants of:

    =IFERROR(INDEX($E:$E,AGGREGATE(15,6,ROW(Table1[[Credit]:[Credit]])/((Table1[[.]:[.]]=$I2)*(Table1[[.3]:[.3]]=J$1)),COUNTIF($J$1:J$1,J$1))),"")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: VB Code or formula to reorganize data

    Modified as per last post. NB. Leading space before "Gift Cards FDCLGIFT" in body of data (3 instances) were deleted.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code or formula to reorganize data

    Hello Glenn:

    Great formula approach.
    Thanks a lot....i will let you know if any further questions/requirement.
    Riz

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: VB Code or formula to reorganize data

    You're welcome, Riz.

  8. #8
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code or formula to reorganize data

    Hello Glenn and other VB Coder:

    I really liked your formula approach however since i have lots of data in as sheet, its slowing down the other calculation process.
    Would be great if this can be achieved by VB Code or some way to activate the formula to calculate when needed.

    Would appreciate help.

    Thanks a lot

    Riz

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code or formula to reorganize data

    Hi Riz,

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  10. #10
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code or formula to reorganize data

    Hello xla:

    Thanks a lot, seems to work.
    The data i am getting is in TEXT format.
    I need to convert into Number formats.
    Can you help change.
    I will test more, if any other issues.
    Thanks\

    Riz

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code or formula to reorganize data

    Hi Riz,

    No strings

    Please Login or Register  to view this content.
    Last edited by xladept; 02-02-2018 at 10:19 PM.

  12. #12
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code or formula to reorganize data

    Hello xla:

    Thanks a lot, i will implement with my data sheet and see if any problem.
    Mostly like it should be ok but is there as way the Lookup you have above can be changed so it looks with text containing...
    example :
    GPC GPC EFT XXXXXX1012FTV , instead of looking at the whole content, if we can have text containing "GPC GPC EFT"
    Gift Cards FDCLGIFT, instead of looking at the whole content, if we can have text containing "Gift Cards"

    Also it will save lots of time to start the next run with the last dated entry instead of running from row2.
    I hope this make sense.


    Please let me know if you have any questions.
    Thanks.

    Riz
    Last edited by rizmomin; 02-03-2018 at 12:41 PM.

  13. #13
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code or formula to reorganize data

    Hi Riz,

    Another way:

    Please Login or Register  to view this content.

  14. #14
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code or formula to reorganize data

    Hello xla:

    Would this take care of

    Please Login or Register  to view this content.

  15. #15
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code or formula to reorganize data

    Hello xladept:

    Just to let you know that i can have date field in cell H2 which will be in format MMMYY.
    Based on the value in cell H2, code should run from data in column A from that point.
    I hope this is clear.
    Please let me know if you have any questions.
    Thanks.

    Riz

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code or formula to reorganize data

    Hi Riz,

    I was able to key on the last deposit entry:

    Please Login or Register  to view this content.
    For the H2 - could you post another sample?
    Last edited by xladept; 02-03-2018 at 01:39 PM.

  17. #17
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code or formula to reorganize data

    Hello xla:

    Please refer to attached file.
    1st time running macro no probem.

    I have pasted more data and run macro again and it erros out at line 3 @ r = F.Row

    I would really prefer to have as follows
    I use the month from dropdown list in H2.
    Then based on the selection, chosse the 1st day of the month from column and use the data down to bring across.
    I hope this make sense.
    Please let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  18. #18
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code or formula to reorganize data

    Try this version:

    Please Login or Register  to view this content.
    * It'll flake out if there is no corresponding date in Column I.
    Last edited by xladept; 02-03-2018 at 08:19 PM.

  19. #19
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code or formula to reorganize data

    Hello xlaDept:

    I am sorry for late response.
    I have been sick with flu.
    This should work and if any further question, will let you know.
    Thanks a lot

    Riz

  20. #20
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code or formula to reorganize data

    Hi Riz old friend,

    Sick with the flu? - I'm sorry and also curious. Did you have a flu shot?

    At any rate: you're welcome and thanks for the rep!

+ 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] VB Code to reorganize data
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-01-2017, 04:31 PM
  2. [SOLVED] VB Code to reorganize data in a row
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2016, 04:41 PM
  3. [SOLVED] VB Code to reorganize data
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-03-2016, 08:57 PM
  4. VBA code to extract and reorganize data from table in Excel
    By Atom in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2016, 01:13 PM
  5. VB Code to reorganize data..
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-19-2016, 11:09 PM
  6. VB Code to reorganize data in a sheet
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2016, 08:27 PM
  7. [SOLVED] VB Code to reorganize data
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 03-29-2016, 04:24 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