+ Reply to Thread
Results 1 to 44 of 44

Copy Paste cells to next sheeet

  1. #1
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Copy Paste cells to next sheeet

    Dear Colleagues please help me I am working to manage vba code but fail. My code work well but one issue involved that data has been pasted on Sheet 2 . I need data on sheet 2 date wise as shown in the image.


    Sub CopyRows()
    Dim lRow As Integer


    lRow = Sheets("Sheet1").Range("H" & Rows.Count).End(xlUp).Row

    For Each cell In Sheets("sheet1").Range("F9:F" & lRow)
    If Cells(cell.Row, "F").Value = "Cash" Then

    Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = _
    Sheets("Sheet1").Range("D" & cell.Row).Value
    Sheets("Sheet2").Range("B" & Rows.Count).End(xlUp).Offset(1, 0).Value = _
    Sheets("Sheet1").Range("F" & cell.Row).Value
    Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Value = _
    Sheets("Sheet1").Range("H" & cell.Row).Offset(2, 0).Value

    End If
    Next cell


    For Each cell In Sheets("sheet1").Range("G9:G" & lRow)
    If Cells(cell.Row, "G").Value = "Cash" Then
    Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = _
    Sheets("Sheet1").Range("D" & cell.Row).Offset(-1, 0).Value
    Sheets("Sheet2").Range("B" & Rows.Count).End(xlUp).Offset(1, 0).Value = _
    Sheets("Sheet1").Range("G" & cell.Row).Value

    Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Value = _
    Sheets("Sheet1").Range("H" & cell.Row).Offset(1, 0).Value

    End If


    Next cell

    End sub
    Attached Images Attached Images
    Last edited by internet_imran; 08-25-2015 at 01:36 AM.

  2. #2
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi,
    . Can you give me a clear “”Picture of what you want in the form of a good “Before” and “After” Picture – BUT NOT AS IMAGES
    - So that I Then I have some copyable test data to work with.


    So 2 sheets please

    .
    The Before should look just as it does before running of any macro.
    .
    . The After should be hand filled by you so that it they / looks exactly as you want it to After running of any macro, based on the actual sample data in the Before

    . Make sure there is just enough data to demonstrate your need. Remember to desensitize the data if necessary, but use the typical Format type and choose your data carefully so that it can be used to test all possible scenarios.
    ...
    To give these "Picture" - a few ways...( The second is what most people do )

    . 1 ) use the Forum Tools in my signature to produce screen shots we can copy to a spreadsheet ( NO IMAGES ! )
    . 2 ) Post Files
    . 2 a) To Attach a sample workbook:
    View Pic
    http://www.excelforum.com/members/da...ch-a-file.html
    http://tinyurl.com/oenwprw

    . 2 b) Send over a file sharing site, such as this free thing
    Box Net,
    https://www.box.com/
    http://tinyurl.com/7chr7u8
    . Remember to select Share and give the link / links they give.

    . 3 c) Only as a last resort, P.M **( Private Message ) . me and i will reply with my Email Addressee so you can send me a file
    ** To PM me, click on my name in the left hand margin when you are logged in, the rest should be obvious.

    Alan
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

  3. #3
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi,
    . I will be droping this one off my lists to answer as you have not replied.
    . It would be helpful if you no longer want help here to mark the Thread as solved
    Thanks
    Alan

  4. #4
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Thank your very much Doc,AElstein
    so nice of you, this is pleasure for me if you help me please.
    Attached Files Attached Files

  5. #5
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi, Thanks fo the PM..
    .
    . Sorry, but it is still not clear to me what you want.
    . You have given me one File, and some description of what you want
    .
    . I need to see the situation Before and After the Macro runs that I do for you.
    .
    . The File that you sent me possibly reflects the “Before” situation ? Or it might be the situation After and so is the After. ?
    .
    . I need you to send me a two Files.

    . File 1: Before
    . A File with reduced test data reflecting the situation before a macro runs.

    . File 2 After
    . In that second file you fill in data manually to reflect the situation after the macro has run. ( based on the actual test data in the before file ) .
    . Note: Please fill it in completely. I note that you have written in your explanation
    ........ “ Same in the remaining acconts
    like Accounts Receivable, payable, Rent expense,
    Divident, utility expense, advertising expense
    +
    end of line total from Debit to credit
    and credit to debit as well....
    ........ “
    .. but that does not explain clearly enough. I cannot guess, for example, where to put data in.
    . Please fill in your After file completely

    . Alan

  6. #6
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Thank you very much Mr. Alan, you give me prompt response.
    please find herewith attachment 2 files as per your requirements.
    Attached Files Attached Files
    Last edited by internet_imran; 09-05-2015 at 02:23 AM.

  7. #7
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi internet_imran,
    . I think I almost understand. But I am a little confused by your before and After.
    Do you want a new sheet to be produced in one File?.
    Or
    Do you wish after the information is obtained in a new sheet that the original should be deleted ?

    .You only have one Sheet in each of the files that you have sent and they are different??

    ..........................
    . Once again :
    . - The before should reflect the situation before the macro runs.
    .
    . The After should reflect the situation after the macro has run.
    .
    ................................................
    . I try now guess to what you want is.
    . I give you a Before and an After.

    .
    . Please:
    . – confirm that this is what you want
    Or
    . - correct the files I send, and send them back so that they represent fully what you have before and what you want after the macro runs.

    Alan.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Thank you Mr. Alan.

    2nd file named Internet_imranafter.xlsm is correct and please focused on it.

    Database and Ledger sheets both will be present in this main file. when we run macro on this file all cells or rows on ledger sheet will be deleted firstly and copy cells from database sheet will be pasted on Ledger sheet.

    Imran Mahmood
    Last edited by internet_imran; 09-07-2015 at 01:27 AM.

  9. #9
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hello Imran Mahmood....

    Quote Originally Posted by internet_imran View Post
    ........
    2nd file named Internet_imranafter.xlsm is correct and please focused on it.
    Database and Ledger sheets both will be present in this main file. when we run macro on this file all cells or rows on ledger sheet will be deleted firstly and copy cells from database sheet will be pasted on Ledger sheet......
    Ok,
    . I will post again if I have more questions or if I have a soulution for you
    Good Day to you
    Alan Elston

  10. #10
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran,
    . I have started on a solution for You
    .
    . I expect with a macro it would be best to delete all information in the Ledger ( not just the data ), and start a fresh. So complete information, including all header information, would be generated rather than just the data.
    . One consequence of this would be that the order of your Headings would come out slightly different to that in your example File.
    . Let me try to explain you with Screeenshot “Pictures”
    .
    . You have supplied hand filled in output data with the headings in this order:

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    S
    T
    U
    V
    W
    X
    Y
    Z
    AA
    AB
    AC
    AD
    AE
    AF
    AG
    AH
    AI
    AJ
    AK
    AL
    AM
    AN
    AO
    AP
    AQ
    AR
    AS
    AT
    AU
    AV
    AW
    AX
    AY
    AZ
    BA
    BB
    BC
    BD
    BE
    BF
    BG
    BH
    BI
    BJ
    BK
    BL
    BM
    BN
    BO
    BP
    BQ
    BR
    BS
    1
    Cash Rent Expense Accounts Receivable Marketing Fees Accounts Payable Salaries Expense Supplies utility expense Telephone expense Advertising expense Dividends
    Ledger


    ...............
    But my program would give this order:

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    S
    T
    U
    V
    W
    X
    Y
    Z
    AA
    AB
    AC
    AD
    AE
    AF
    AG
    AH
    AI
    AJ
    AK
    AL
    AM
    AN
    AO
    AP
    AQ
    AR
    AS
    AT
    AU
    AV
    AW
    AX
    AY
    AZ
    BA
    BB
    BC
    BD
    BE
    BF
    BG
    BH
    BI
    BJ
    BK
    BL
    BM
    BN
    BO
    BP
    BQ
    BR
    BS
    1
    Rent Expense Cash Accounts Receivable Accounts Payable Supplies Salaries Expense Utilities Expense Telephone Expense Advertising Expense Dividends Marketing Fees
    Post10Suggestion

    .. would that be acceptable ?
    . Please reply.
    Thankyou
    Good day to you
    Alan Elston

  11. #11
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Thanks Mr. Alan

    Yes, this would be best to delete all information with their headers rows firstly in the Ledger sheet and fresh data generated after that.

    My purpose to create T-Call Accounts summary on ledger sheet from database sheet with their debit and credit values after that their sum and balance as well.
    Output data style provided by you is also good, because this is no matter which account is first and second, third and so on come after running the macro.

    Imran Mahmood

  12. #12
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran
    Quote Originally Posted by internet_imran View Post
    ....Yes, this would be best to delete all information with their headers rows firstly in the Ledger sheet and fresh data generated after that......
    Output data style provided by you is also good, because this is no matter which account is first and second, third and so on come after running the macro.
    ...
    OK
    I get back on to it tomorrow
    Alan

  13. #13
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: Copy Paste cells to next sheeet

    Imran,

    You could approach this task without VBA. I recommend
    • Use an Excel Table on 1 Worksheet for your Inputs
    • Setup your report as required on a separate Worksheet
    • Add helper labels as needed to be used as Criteria with SUMIFS() formulas (You may hide these Rows and Columns)
    • Add Structured Reference Formulas as needed to summarize the data to fit your report

    Refer to these links:
    Excel Tables
    Structured References
    Kind regards,
    w

    http://dataprose.org

  14. #14
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Goss
    Quote Originally Posted by goss View Post
    .....
    You could approach this task without VBA. I recommend
    ........
    . Thanks for that input. It looks like a very good idea, and probably is a better way to do it than mine:. I am just learning by answering Threads here. Unfortunately I have no idea of Tables, having jumped ahead a bit getting into VB before I really understood more than very basic Spreadsheet stuff.
    . I expect Imran will have no chance looking at the Info that you suggested due to language problems!
    .
    . I think it would certainly be very interesting to see an alternative “spreadsheet solution” of the kind you suggest.
    . If possible you could consider giving such a solution. But I appreciate that may be much work, - I really have no idea.
    .
    . Alternatively, maybe some sort of conditional formatting could be done to compliment my Code solution to give the OP his original required table forms. - At the current stage of my code i am only giving the OP only his required values.
    .
    . This is consistent with my “VBA Array” approach where I capture everything from the input sheet in one go ( or rather .values) , and then after creating an “internal” VBA output Array, I past that output ( again currently just values ) in one go.
    .
    . The next step would be for me to include lines to output the format at various code points. This would somewhat go against the basic principal of my method and could be a bit messy.
    . . So i am guessing that conditional Formatting might be more efficient, although i also have no experience at all in that area.
    .
    . Maybe you could comment on that?
    . Thanks for adding to the Thread.

    Alan

  15. #15
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Good Day Imran,

    . I have an initial code for you.
    . Currently it is only working to give you your required output values. I have not yet included any Formatting.
    . I suggest that initially you try to apply the code to your Workbook.
    . Then report back and we can discuss how to take it further.
    .
    . For the benefit of others following this Thread or wanting to use the code, or versions thereof in the future , I summarise what we are doing.
    .
    . Here is a small sample of your supplied Sheet 1 Input Data:
    .
    Using Excel 2007
    Row\Col
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    3
    General Journal
    Page 01
    4
    Post.
    5
    Date Description Ref.
    Debit
    Credit
    6
    Debit Credit
    7
    2015
    8
    July
    2
    Rent Expense
    100
    9
    Cash
    100
    10
    Paid October rent
    11
    12
    3
    Cash
    6,000
    13
    Accounts Receivable
    6,000
    14
    Received cash on account
    15
    16
    7
    No entry
    0
    17
    18
    10
    Accounts Receivable
    300
    19
    Marketing Fees
    300
    20
    Billed customers for services
    21
    22
    12
    Accounts Payable
    400
    23
    Cash
    400
    database

    .....................
    After Running the Code I give you this is a small extract from the output you achieve in the second sheet

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    1
    Rent Expense Cash
    2
    July Credit Credit July Credit Credit
    3
    2
    100
    3
    6000
    2
    100
    4
    100
    0
    12
    400
    5
    Bal
    100
    15
    600
    6
    24
    800
    7
    25
    900
    8
    30
    1200
    9
    31
    1300
    10
    6000
    5300
    11
    Bal
    700
    12
    Ledger


    ................

    . The initial code version I have for you here:
    http://www.excelforum.com/developmen...ml#post4185723

    . very briefly the code does this,
    Code Description:
    . 1) Initial Sheet info. And Input Data is collected. In particular the entire Input sheet is “captured to an large “internal” VBA Array. And Sheet 2 is completely cleared

    .2 ) The Microsoft Scripting Runtime Dictionary technique is used to give a unique list for your Account headings.

    .3) A main loop is done for each Account. In this Loop an putout Array is built up of the form you require ( Currently just the values, no formatting ) .The entire contents of this Array are then pasted out to sheet 2. The loop then continues for the next Account. ( Each Output table is offset from the last by a fixed interval )

    Some Further general Notes

    . The code is much larger and detailed as necessary. It can easily be simplified once you are happy with a final working version. At this stage the full explicit code is helpful to me in understanding and remembering what I did, should you require further help and advice!

    . See how you get on and report back please.
    Alan

  16. #16
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Many Many thanks Mr. Alan to do extraordinary effort to formation the code. code work well but this is not possible for me to understand the code.

    I changes on ledger sheet for better understanding to final touch on the code. please find attached file with this reply.

    Imran Mahmood
    Attached Files Attached Files
    Last edited by internet_imran; 09-12-2015 at 01:45 AM.

  17. #17
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran,
    Quote Originally Posted by internet_imran View Post
    Many Many thanks Mr. Alan.....
    You are welcome. Thanks for the feedback
    .....................................................

    Quote Originally Posted by internet_imran View Post
    .... but this is not possible for me to understand the code.
    .. I changes on ledger sheet for better understanding to final touch on the code. ....
    .. From Post # 15
    Quote Originally Posted by Doc.AElstein View Post
    ......
    . Currently it is only working to give you your required output values. I have not yet included any Formatting.
    . I suggest that initially you try to apply the code to your Workbook.
    . Then report back and we can discuss how to take it further.......
    . So I would just like to confirm

    . 1) You tried the code and you got it to work ?

    . 2) Are you happy that the code is working ( But only values ,) ? Does it give you the correct values that you want?
    .
    . 3) You would now like me to further modify the code to put the formatting in, as you showed in your uploaded file ? Like this:...

    . 3 a ) You want me to change this :

    Attachment 418628

    to this:

    Attachment 418630..

    ( I hope you can see these? - there are sometimes Excel Forum difficulties with Images ?

    . 3 b ) I have never done any formatting and it would certainly I expect slow down and do away with many advantages of my “VBA Array” type code, as i will be accessing the sheet frequently. However I expect I can get many of the steps running a macro recording whilst manually making those changes.
    Quote Originally Posted by internet_imran View Post
    Many thanks to formation the code. code work well but this is not possible for me to understand the code.
    I changes on ledger sheet for better understanding to final touch on the code. please find attached file with this reply......
    . Yes, Then I will modify and adapt into my program. I shall attempt this for you later if you are unable and wish me to.
    . You have given very clear instruction as to what you want in the File that you attached. Thankyou for your efforts there
    Alan

  18. #18
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Quote Originally Posted by internet_imran View Post
    ......code work well but this is not possible for me to understand the code.......I changes on ledger sheet for better understanding to final touch on the code. .....
    Hi Imran,
    . I will assume you wish me to modify my code for your Format requirements. I was wanting some confirmation of that, but you may have not understood too well.
    .
    . So:
    . My approach is fairly straight forward: "......I needed a macro modification that is so simple it could be written with the macro recorder....”
    .
    . The important code line are all unknown to me so I simply ran a macro recording whilst making Format changes of the sort you have asked for.
    .
    . The trick is then to know where to put that Formatting in. After section 3b) the relevant cell co-ordinate info is there, but I will start this section as at point 3e) as my Output Array has been transposed to the correct final orientation and is somewhat easier now to visualise. Horizontal co-ordinates are in the same relative position but are offset by the Long variable TablesOffset

    Criteria Given by Imran:

    Please made some change:

    Bold and Underline style
    1) Heading cells bold + Balance cells bold
    2) 2nd row bold like Month name , debit and credit cells
    3) Top border on July , Debit and Credit cells
    4) Top border on Bal Cells data
    5) on Debit Cells Column come Right Border

    Merge cells data

    1) Heading cells Merge
    2) Debit Cells Merge
    3) Credit Cells Merge like as above


    . The Following code was obtained after:

    . 1 ) “Tidying up” that code given by macro recorder

    Please Login or Register  to view this content.
    .............................................
    . 2 ) Some of the cell “row” co-ordinates are replaced by appropriate Array parameters that could vary from table to table

    Please Login or Register  to view this content.
    ... the above code then needs to be incorporated into section 3e).
    . A nice convenient way to do this was to treat all the above lines as Range Properties and arrange for them to be applied to the Range Object which is the Top left cell of each Table. This cell is already used in the code as the reference start point for each Table. This makes good use of the Code section obtained from the Macro by Virtue of the fact that Cell and Range properties relate to the relative positions “going out” from the point of that Range Object
    http://excelmatters.com/referring-to-ranges-in-vba/
    http://www.mrexcel.com/forum/excel-q...ml#post4034765
    . Section 3e) then becomes

    Please Login or Register  to view this content.
    Full modified code here:
    http://www.excelforum.com/developmen...ml#post4188405
    And here
    http://www.excelforum.com/developmen...ml#post4188406

    NOTE: The code was too big to fit in one post. BUT IT IS ALL ONE PROGRAM. Copy the second part immediately under the first part in the same module.

    This is a small part of the new Output achieved

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    E
    F
    1
    Rent Expense
    2
    July
    Debit
    Credit
    3
    2
    100
    4
    100
    0
    5
    Bal
    100
    6
    Ledger
    ( My screenshot does not show the new formating, but it IS there as you wanted)
    . Please let me know how you get on.

    Alan
    Last edited by Doc.AElstein; 09-17-2015 at 06:25 PM.

  19. #19
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Thanks Mr. Alan and also sorry for giving you response very late.

    The code provided by you worked perfect.
    4 issues were pending and i could not discuss with you and skip by me as this was mention in my earlier emails. (attached file)

    1). In Business Accounting T-Call Accounts are worked based
    on two columns Debit and Credit side and then Balance from the
    Debit and Credit Column. Becuase some Accounts Bal come on Debit
    side and some on Credit Side as i highlighted above for you.

    2). I need dash instead of 0. if zero come on debit and credit
    side and in the total Balance as below format style.



    3). is this possible aftet running the code ledger sheet update with
    paste link instead of values.

    4). Top Border on Balance Cell data + Border on total Debit , Total credit column data
    Attached Files Attached Files

  20. #20
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran
    . I do not understand


    File internet_imranAfter_3

    Sheet 1
    Marketing Fees Credit 300
    ____________ Credit 1100

    Marketing Fees 1.JPG


    ..........................................


    Sheet3
    Marketing Fees Credit 300
    ____________ Debit 1100 ????

    Marketing Fees 2.JPG

  21. #21
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Yes, Mr. Alan Thanks to point me.
    Correct summary will be as below in snapshot.
    Attached Images Attached Images

  22. #22
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    _ Hi Imran
    Quote Originally Posted by internet_imran View Post
    ...........
    1). In Business Accounting T-Call Accounts are worked based
    on two columns Debit and Credit side and then Balance from the
    Debit and Credit Column. Becuase some Accounts Bal come on Debit
    side and some on Credit Side as i highlighted above for you.
    _
    _ How do I know which Account should be on which side ??



    _ is this the answer:

    _1 Accounts Payable and Marketing Fees on Balance on Credit side ?

    _2 All others on debit side ?

    _ is 1 and 2 correct ?
    _ Alan
    Last edited by Doc.AElstein; 09-18-2015 at 08:39 AM.

  23. #23
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Dear Alan below is a snapshot

    Trial Bal.JPG
    Last edited by internet_imran; 09-18-2015 at 06:14 PM.

  24. #24
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran,
    Quote Originally Posted by internet_imran View Post
    Dear Alan below is a snapshot....
    _
    _ I cannot find that on any File that you have given me-

    _ Should
    _ 1) my Code check That?
    _ OR
    _ 2) Will it allways be the same as in that Screen shot ?
    _
    _ If it is always the same as in that screen shot then please post me that infomation agian in an uploaded File, because I cannot Copy your Image. It would be easier for me to copy that Infomation from a file than typing all that infomation out by hand

    Alan

  25. #25
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Dear Alan the above screenshot is only for your review and record. I mean to say, this is a specimen two columns are placed in Trail Balance sheet one is Debit and 2nd is Credit. So, both column (Debit & Credit ) is the result of Ledger sheet. Which we have already worked. Debit Side Balance and Credit Side Balance of Ledger Sheet (each account) will come on Trial Balance Sheet one by one.

  26. #26
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hello Imran,
    Quote Originally Posted by internet_imran View Post
    ........ Debit Side Balance and Credit Side Balance of Ledger Sheet (each account) will come on Trial Balance Sheet one by one.
    _ Very Sorry but I still do not understand you fully.

    _ My 2 questions were

    _ 1) How do I know which side ( Credit or debit ) to put the Bal. ?

    _ is this the answer as in your uploaded File ” internet_imranAfter_3” ? :

    _ 1a)
    Debit Side:
    Cash , Rent Expense , Accounts Receivable , Salaries Expense , Supplies , utility expense , Telephone expense , Advertising expense , Dividends

    Credit Side:
    Marketing Fees , Accounts Payable

    OR
    _ 1b)
    _ is the answer as in your screenshot
    Debit Side:
    Cash , Rent Expense , Accounts Receivable , Salaries Expense , Supplies , utility expense , Telephone expense , Advertising expense , Dividends

    Credit Side:
    Marketing Fees , Common Stock , Accounts Payable , Retained Earnings

    OR
    _ 1c) Can it change from Month to month? If it can change, where should my code look for this new information ? I still do not have this information in any file you have given me

    2) Please read again my Post #24. It would be helpful to have the information typed into the Thread or given in a File so I can copy it. I cannot copy information from an Image and so must type everything out by hand as I have done above..

    _ I think I am close to understand you now. We just need to clear up how I would definitely know on which side, Credit or Debit, an Account Bal. comes


    Best Wishes
    Alan

  27. #27
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Dear Mr. Alan I m confused how to explain this?
    Please find attached file there are notes on Ledger sheet for you.

    Thanks

    Imran
    Attached Files Attached Files

  28. #28
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran,
    _ I think I do understand most of what you have said. And I am very close to a solution for you. I am still not too clear how I would know which side Debit, or Credit an Account balance should go.

    _ Let me try again to ask:

    _ Shall i assume that,

    If present
    Cash , Rent Expense , Accounts Receivable , Salaries Expense , Supplies , Utility Expense , Telephone expense , Advertising Expense , Dividends
    Will always be on Debit side

    And

    If present
    Marketing Fees , Common Stock , Accounts Payable , Retained Earnings
    Will always be on the Credit Side

    Is that correct?





    Alan

  29. #29
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Dear Alan the above statements assumed by you are correct, but these accounts are changed month to month and may be accounts greater than these numbers.

    imran
    Last edited by internet_imran; 09-23-2015 at 06:44 AM.

  30. #30
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran
    Quote Originally Posted by internet_imran View Post
    Dear Alan the above statements assumed by you are correct, but these accounts are changed month to month and may be accounts greater than these numbers.
    ...

    That is what I thought. And asked I had asked you to confirm that in post # 26 !!!
    Post #26:
    Quote Originally Posted by Doc.AElstein View Post
    .....
    _ 1c) Can it change from Month to month? If it can change, where should my code look for this new information ? I still do not have this information in any file you have given me,.,,,,,


    _ So how will I or my code know?. How should i or my program get that Information each month?
    _ Where would this information be held.

    _ My program cannot “guess” each month!

    Alan

  31. #31
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Dear Alan this is not possible for me How to explain this because I have no idea about this.
    Imran

  32. #32
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Quote Originally Posted by internet_imran View Post
    Dear Alan this is not possible for me How to explain this because I have no idea about this.
    Imran
    Hi Imran
    Ok, I think I understand.

    I will write my program for now such that I have two Arrays Holding the following information

    For Credit Side:
    CSide() = Array("Marketing Fees", "Common Stock", "Accounts Payable", "Retained Earnings")


    For Debit Side:
    DSide() = Array("Cash", "Rent Expense", "Accounts Receivable", "Salaries Expense", "Supplies", "Utility Expense", "Telephone Expense", "Advertising Expense", "Dividends")

    This could then be changed at a later date if it is different for a different Month

    Please let me know if that is acceptable

    Alan

  33. #33
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Yes, this is acceptable.
    Imran

  34. #34
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Quote Originally Posted by internet_imran View Post
    Yes, this is acceptable.
    Imran
    OK. I will post again when i have the new code finished
    Alan

  35. #35
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran,
    _ This has been an interesting learning experience, with ever changing requirements. This is reflected in the Program which initially as a Simple sorting based on values making use of Internal Arrays is now working backward to interact with the worksheet so much that a complete rethink using full use of spreadsheet Methods and Functions would be sensible.. The program is now very long and inefficient, but WTF..
    Anyways...

    1). In Business Accounting T-Call Accounts are worked based
    on two columns Debit and Credit side and then Balance from the
    Debit and Credit Column. Becuase some Accounts Bal come on Debit
    side and some on Credit Side as i highlighted above for you.
    - ... See posts #22 – Post # 32 You Do not know yourself what you require here. So as agreed I have in my code 2 Arrays
    For Credit Side:
    CSide() = Array("Marketing Fees", "Common Stock", "Accounts Payable", "Retained Earnings")
    For Debit Side:
    DSide() = Array("Cash", "Rent Expense", "Accounts Receivable", "Salaries Expense", "Supplies", "Utility Expense", "Telephone Expense", "Advertising Expense", "Dividends")
    These would possibly then be changed at a later date if it is different for a different month

    2a). I need dash instead of 0. if zero come on debit and credit
    side
    _ If SumC or SumD = 0 , then they =”-“ instead. This is dine on its own and as part of the next requirement. More details to the Mehtod in the referenced Thread.
    2b) and in the total Balance as format style. _(_##,##0_);[Red](_##,##0);_(_#?"—"??_);_(@_)
    _ From Kaper
    http://www.excelforum.com/excel-gene...italicise.html
    _ The new code section ‘3g) which I have added achieves something close to what I think you want .
    More details to the magic code Line that does this in the referenced Thread.

    3). is this possible after running the code ledger sheet update with
    paste link instead of values.
    3a) Specifically the Links
    _ From Comfy
    http://www.mrexcel.com/forum/excel-q...l?#post4286219
    The “Links” were done at the points in the code where previously the values were. It was convenient to do this here as the row and column Indicies required to build up the String formula for the link were readily available.
    3b) I am assuming you also want formulas for the totals ( SUMS ) and for the calculated balance ( or else the point of 3a) is lost...
    This was very tedious and tricky. Again i have had help from more experienced Forum Members
    http://www.mrexcel.com/forum/excel-q...l?#post4289757
    Based on the above Link 3 formulas are built and placed in the Output Array.

    4). Top Border on Balance Cell data + Border on total Debit , Total credit column data. See Post # 18
    "......I needed a macro modification that is so simple it could be written with the macro recorder....”

    Latest Code here
    http://www.excelforum.com/developmen...ml#post4198205
    And here
    http://www.excelforum.com/developmen...ml#post4198215
    And here
    http://www.excelforum.com/developmen...ml#post4198218


    , ( As previously code is split because it will not fit in one Post! This time in three parts BUT IT IS ALL ONE CODE. COPY Second part directly under First part and the Third part directly under the second part in the same Module ).


    Typical Output:
    Attachment 420907


    I think it is very close now to what you want. I anticipate only a few minor adjustments , if any ,are now needed.
    Please let me know how you get on
    Alan

  36. #36
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Thanks Mr. Alan your code is superb. But I need minor change in the subtraction as below picture is attached for you.
    Subtract Criteria from Balance.JPG
    Last edited by internet_imran; 09-24-2015 at 04:23 PM.

  37. #37
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran
    Quote Originally Posted by internet_imran View Post
    ....But I need minor change in the subtraction as below picture is attached for you. .....
    _ Yes I understand.

    _ I think I may have overlooked that
    _ I will correct and Repost or modify the Code later today or tomorrow

    Alan

  38. #38
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran

    _ Ok, I have made this correction.

    This
    Please Login or Register  to view this content.
    Is replaced with this
    Please Login or Register  to view this content.
    _ Basically If the Final Bal result and the word “Bal” has been shifted ( indicated by Variable DToC being <> 0 ( = 3 ) then the Summation is done the other way around

    I have modified the Third Part of the Code here
    http://www.excelforum.com/excel-prog...-sheeet-3.html

    Please let me know how you get on
    Alan

  39. #39
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Hi Alan!

    Thank you very much, I appreciate your help. your code is perfect what i need.

  40. #40
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi Imran,
    Quote Originally Posted by internet_imran View Post
    ....
    Thank you ..... your code is perfect what i need.
    You are welcome
    Glad we finally got there in the end.

    Alan

    P.s
    If you ara now fully happy with the solution then please

    Mark this thread as solved...

    ThreadSolved.JPG
    Attached Images Attached Images
    Last edited by Doc.AElstein; 09-28-2015 at 01:02 PM.

  41. #41
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Yes, Alan
    But this is the first part of my assignment that are solved by the help of you but second and third is also pending which i have not discussed yet.
    So What i do?
    is I have to post a new thread for the second and third Assignment after mark this thread as solved?

    Imran

  42. #42
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Hi
    Quote Originally Posted by internet_imran View Post
    ....are solved by the help of you but second and third is also pending......
    So What i do?
    is I have to post a new thread for the second and third Assignment after mark this thread as solved?
    .......

    Yes ...... post a new thread for the second

    Yes ...... post a new thread for the third

    Yes ...... mark this thread as solved now

    But also when you start a thread

    you should
    1) Put a reference Link ( URL ) to this Thread, so
    Start those Threads by writing something like
    " This is following on from the code developed here:
    http://www.excelforum.com/excel-prog...xt-sheeet.html
    ... and etc. etc....

    and you could
    2) also reply again to this Thread and say you are starting a new Thread and give the link to the new Thread in that reply)


    Alan

    P.s.
    Usually you can copy the link ( URL ) from somewhere at the top of your Internet Browser


    URL.JPG

  43. #43
    Forum Contributor
    Join Date
    12-24-2005
    Posts
    104

    Re: Copy Paste cells to next sheeet

    Hi Alan
    I format the code but not does not work please help me out.

    Thanks

    http://www.excelforum.com/excel-prog...ext-sheet.html

    Imran

  44. #44
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Copy Paste cells to next sheeet

    Quote Originally Posted by internet_imran View Post
    Hi Alan
    I format the code but not does not work please help me out.

    Thanks

    http://www.excelforum.com/excel-prog...ext-sheet.html

    Imran
    Hi Imran,
    Here is my next code for this project
    http://www.excelforum.com/excel-prog...ml#post4229760

    Alan

+ 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. Open another excel file and copy data to sheet 2 while button upload is in sheeet 1
    By rflorentino in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2014, 08:47 PM
  2. copy maths equation from one sheeet to other sheet
    By newmake in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-28-2014, 09:46 AM
  3. Copy & paste in macro doesn't paste all cells
    By pltrapper in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-13-2013, 09:22 AM
  4. [SOLVED] VBA to Copy set data, paste into set cells, then copy more & set into cells related 2 date
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 99
    Last Post: 02-01-2013, 08:43 AM
  5. Replies: 1
    Last Post: 01-16-2013, 05:36 AM
  6. Problem with copy data from "sales" sheet to each customer sheeet
    By jimparker65 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2013, 04:46 AM
  7. Copy and paste non consecutive cells and paste consecutively in another workbook
    By macquhele in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-12-2011, 02:36 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