+ Reply to Thread
Results 1 to 23 of 23

Copying some informations

  1. #1
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Copying some informations

    Hello dear Sir,

    Please see attached copy spreadsheet which contains - sheet1 and sheet2.

    Sheet1 - all information.
    Sheet2 - destination.

    There are some invoice details (sheet1) which should be copy to Sheet2 as appropriate ranges.

    There are 3 steps:

    STEP 1

    1. Invoice number - (sheet1, from column C) should be copy to sheet2 (column J).
    2. Date - (sheet1, from column D) should be copy to sheet2 (column H).
    3. Amount - (sheet1, from column K) should be copy to sheet2 (column E)
    4. Currency - (sheet1, from column J) should be copy to sheet2 (column C)
    5. Acc. - (sheet1, from column A) should be copy to sheet 2 (column D)
    6. put "SH" word to column A in sheet2 and column I from sheet2 should be +30days from rage H in sheet2.

    STEP 2

    1. put "SV" word to the second row after "SH" in column A (sheet2)
    2. Currency(sheet2) should be copy to column C from sheet2 (previous row)
    3. Amount(sheet2) should be copy from column E to column D sheet2 (previous row)

    STEP 3

    1. put "SN" word to the next row after "SV" in column A sheet2
    2. Same as currency
    3. Go to sheet1 and take nominal code from column B and copy to column D in sheet2.
    4. Go to sheet1 and take ACC. from column A and copy to column A (only letters) and copy to column F (only digits) - for example: AAB(column E) 005(column F)
    5. Go to sheet1 and take amount(appropriate row) from column K and copy to column G in sheet2.
    6. Go to sheet1 and take Description(appropriate row) from column G and copy to column G in sheet2
    7. Go to sheet1 and take Name(appropriate row) from column H and copy to column I in sheet2
    8. Go to sheet1 and take Placement(appropriate row) from column I and copy to column J in sheet2.
    9. Go to sheet1 and take Nominal code from column B and copy to column K in sheet2

    You will see example copy of information from sheet1 to sheet2 in attached file.

    Many Thanks in Advance

    Regards

    Halid
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    Hi,

    I followed your instructions until STEP 2 and then did not understand what you meant from there?

    Open the attached and run the macro by clicking the Transfer Data button on sheet 2.
    It will copy the data from sheet 1 into the appropriate places, but from STEP 2 i loose what you mean...

    Please clarify
    TX
    Attached Files Attached Files
    Regards,
    Rudi

  3. #3
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    Hi RudiS,

    Sheet2 is an example. You can see how informations copied from sheet1 to sheet2. These numbers and amount change each time and I need to enter manually from sheet1 to sheet2 format. The base informations are on sheet1 which change every day. But I see your macros didn't put correct amounts and descriptions to the correct ranges in sheet2.

    Hope this will help you to write new macros. Just see sheet2 and you will get how and where it should be copy informations.

    Best Regards

    Khalid

  4. #4
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    Sorry Khalid, this does not help me.
    I can only go on what you tell me, and as I mentioned, I followed the first 6 steps:
    1. Invoice number - (sheet1, from column C) should be copy to sheet2 (column J).
    2. Date - (sheet1, from column D) should be copy to sheet2 (column H).
    3. Amount - (sheet1, from column K) should be copy to sheet2 (column E)
    4. Currency - (sheet1, from column J) should be copy to sheet2 (column C)
    5. Acc. - (sheet1, from column A) should be copy to sheet 2 (column D)
    6. put "SH" word to column A in sheet2 and column I from sheet2 should be +30days from rage H in sheet2.


    Which brings me to what the macro does on sheet 2 (the sample I attached)
    After the first 6 steps, I do not understand these two steps (because they don't seem to match the info in the sample?):
    2. Currency(sheet2) should be copy to column C from sheet2 (previous row)
    3. Amount(sheet2) should be copy from column E to column D sheet2 (previous row)


    And then I cannot go further as I start loosing the process.

    In order to help you further, I propose we take this step by step.
    If you can run the macro I provided in the sample file but clicking the transfer button, please see what it does, and then make changes to that...to illustrate to me what you need, where the macro is right and where it is wrong. I can then correct if for these 6 steps. When they are correct, we can move to step 2 and so forth...
    Send me back a copy of my attachment with the corrections I must make. Please be clear in your instructions as the info which is familiar to you is NOT famaliar to me...I do not know what you want unless you clearly state the objectives.

    TX
    Attached Files Attached Files
    Last edited by RudiS; 04-08-2014 at 05:31 AM.

  5. #5
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    STEP 1

    3. Amount - (sheet1, from column K) should be copy to sheet2 (column E) - I meant ONLY total amount should be copied but you copied all amounts. Row 5(sheet2), A5 should be SV as per "copy example" sheet. Then Total amount (37169.08) should be copied next row (D5)(sheet2). Then next row (A6) should be "SN" and B3:B9(sheet1) should be copied to D6:D12(sheet2) and amounts K3:K9(sheet1) should be copied to G6:G12(sheet2) and names H3:H9(sheet1) should be copied to I6:I12(sheet2) and I3:I9(sheet1) should be copied to J6:J12(sheet2) as per example sheet. This is example for one invoice (BXP7183).

    Could you please write macro for one invoice and we will use this macros for other invoices? I know I didn't explain exactly, sorry.

    Red highlighted ranges are correct in your macros. You need to copy as per blue highlighted ranges.
    Regards

    Khalid
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    TX for the extra detail. I'll start to work on it as see what I can do.

  7. #7
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    Hi,

    I have the completed macro for you. It is working well.
    Attached.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    Super, it is working and everything is OK Just I need a little bit change..

    1. Start to put number "26" from starting B4 in sheet2 to the end.
    2. Please see sheet2 after running macros: Range E4 and D5 should be shown as a simple digit, like this 37169.08 (not AZN 37069.08).
    3. Please put each "SH" starting row number "4" (range G4), for example, it should be put range G13, G16, G19 etc..
    4. The font should not be bold, just simple and Arial 6.
    5. Dates in column H (sheet2) should be as 07/02/12 format (not 07.02.12)

    Please check below and after this will be last request and then work will be done.

    I was in Cape Town in February 19-24. I visited to "Cape of good Hope" and Langa place where poor people live. Then we went to wine yard. Very nice and great places. I enjoyed.

    Thank you that you help me.

    Best Regards
    Halid

  9. #9
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    Ah, yes. I forgot to ask about that 26? You never mentioned that in any of your other posts and even though it was in your samples, I was not sure if it would be 26 for each of the invoices. I will put that into the macro and also clean up the font and other things. Glad it is working though.

    That is great about your visit to Cape Town. There are a lot of beautiful areas here, like Cape Point and the winelands of Franschhoek and Stellenbosch. I've stayed here all my life and I still enjoy those areas a lot. It's great that you visited Langa too, but interesting that you visited there as it's not a common place that tourists would go to.

    Macro coming shortly...

  10. #10
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    Hi,

    Here is the new macro. The code mimics the sample sheet exactly.
    Formatting, or the removing of it is also in place now.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    Hi,

    We visited Langa place for seeing how people live there. I loved Cape Town. We stayed in 12 Apostles hotel.

    Macros working very good and thank you!

    Sorry for being a head pain but this is the last to add some commands:

    1. As you see macros take BXP prefix number (BXP7183) from sheet1 and copy to range J4 in sheet2. We have some invoices which is concerning "C/N". For example, BXP7188 C/N, C/N-it means minus in Accounting. So, Normal invoice will be as BXP7183 (7183 as example) but Credit note will show BXP7188 C/N (we put "C/N" at the end of BXP numbers). So, If we see "C/N" word in J column (sheet2), then put number "5" in column J (sheet2) instead of "4". It means if we see invoice like BXP1234 without "C/N" word, then put number "4" to appropriate range in column G (sheet2). Otherwise please put "5".

    2. As you see invoice number starts from BXP7183(from the first invoice). But if you want to start from the BXP7186? Could you please add button that I enter BXP start number and then macros should start from this number and go down at the last row?

    I know this is too long but if you help me, I will be very glad

    Best Regards

  12. #12
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    Hi,

    We visited Langa place for seeing how people live there. I loved Cape Town. We stayed in 12 Apostles hotel.

    Macros working very good and thank you!

    Sorry for being a head pain but this is the last to add some commands:

    1. As you see macros take BXP prefix number (BXP7183) from sheet1 and copy to range J4 in sheet2. We have some invoices which is concerning "C/N". For example, BXP7188 C/N, C/N-it means minus in Accounting. So, Normal invoice will be as BXP7183 (7183 as example) but Credit note will show BXP7188 C/N (we put "C/N" at the end of BXP numbers). So, If we see "C/N" word in J column (sheet2), then put number "5" in column J (sheet2) instead of "4". It means if we see invoice like BXP1234 without "C/N" word, then put number "4" to appropriate range in column G (sheet2). Otherwise please put "5".

    2. As you see invoice number starts from BXP7183(from the first invoice). But if you want to start from the BXP7186? Could you please add button that I enter BXP start number and then macros should start from this number and go down at the last row?

    I know this is too long but if you help me, I will be very glad

    Best Regards

  13. #13
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    Hi,

    Updates added
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    Sorry, please see attached error when I put BXP number to start copying...
    Attached Images Attached Images

  15. #15
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    Sorry, it is working good! I put invoice number manually)) But it should be selected by mouse)

    Many Thanks RudiS. Thanks for your help!

  16. #16
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    Yep...I thought selecting it with the mouse would be easier AND more accurate.
    Glad its working.

  17. #17
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    Hello Rudi,

    Hope you are well. What about weather in Cape Town?

    Please see attached excel file and please play macros. Macros thinking over 15 minutes after playing macros. Could you please reduce time or any additional code which will be 1-2 minutes?

    Best Regards

    Khalid
    Attached Files Attached Files

  18. #18
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    Hi,

    Weather is cooler now Thank goodness as it was in the high 30's for most of last week...

    I will have a look at in this evening....

  19. #19
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    Hi,

    The first loop process, to fill blank cells can be entirely eliminated with this code which instantly fills the blank cells, if they exist.

    Please Login or Register  to view this content.
    The main body that uses the COUNTIFS functions to compare cells and count results...is the *killer* here. You are dealing with an outer loop of 800 cycles, and each cycle has an inner loop of 3000 odd cycles! That is 2.5 million loops and this is doubled with a second similar loop to compare two other columns. Just less than 5 million loops... No wonder the run time is so much!

    I cannot figure out what you are doing with the comparing of the columns? Could you provide a formula on the spreadsheet that does what you need. IOW: can you create the formula that the code is using on the spreadsheet that provides the calculating you need. If I can get this formula from you, we can formulate a range and simply input the formula into the range instead of looping a formula one at a time into each cell.

    TX

  20. #20
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    Thanks Rudis, I will sent it.

  21. #21
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    Hi Rudis,

    Hope you are well.

    Please see attached spreadsheet and macros which copying informations from Registration sheet to Cashbook sheet.

    As you see if column F+H(Registration sheet) equal to C+S(Cashbook sheet) then go to sheet Registration and take appropriate range from column C(BXP numbers) and copy to column V(Cashbook sheet), then take amount from column K(Registration sheet) and copy to column X(Cashbook sheet).

    The first problem is you see yellow highlighted rows in Registration sheet, there are two "inv" numbers match with two rows from Cashbook sheet. But macros took only 635.13 amount and copy to column X (Cashbook sheet). It should be copy also 5461.23. First row in Cashbook sheet should be 5461.23 and second row 635.13.

    Please help in this and then we will continue second step.


    Many Thanks RudisCash book indi numune.xlsm

  22. #22
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Copying some informations

    Hello Halid,

    I looked at the code and could not find a solution based on the current macro setup. In my opinion, its missing an extra loop that should check for duplication within each invoice. Without this extra loop, it is writing the data for Andrew with both entries as 5,461 the first time and then overwrites then with the 635 value. I tried to place the second loop in there, but due to the current construct of the VBA it is just not compatible. Basically I would have to rewrite the entire macro and I'm not willing to do that as I am not familiar with the current invoicing process. Things like this cannot afford errors and I cannot put myself into that position.

    Is it not possible to draw on the expertise of someone from your IT department to do this? Alternatively, post it in a new thread and see if anyone is willing to review/rewrite it with their own ideas.

    My apologies for the inconvenience

  23. #23
    Registered User
    Join Date
    09-14-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Copying some informations

    Thanks Rudis.

+ 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. Three Informations in one Bar Chart
    By tehNewbie in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-18-2013, 05:51 AM
  2. Copy, pasting the informations
    By share knowledge in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-20-2009, 04:45 AM
  3. Getting informations from several workbooks
    By z00misen in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-15-2006, 07:47 AM
  4. informations about MAP
    By Marina Limeira in forum Excel General
    Replies: 1
    Last Post: 01-19-2006, 05:30 PM
  5. informations search
    By DanBal in forum Excel General
    Replies: 4
    Last Post: 06-06-2005, 06:05 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