1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. 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...

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

Macro not working:

Discussion in 'VBA Macros' started by Richard Halls, Jan 24, 2017.

  1. Richard Halls

    Richard Halls New Member

    Messages:
    13
    The attached file has code that is not working.

    Attached Files:

  2. Monty

    Monty Well-Known Member

    Messages:
    700
    Hello Richard.

    Welcome to forum.

    Could you please explain me more..What you are trying to do..

    Thanks
  3. Richard Halls

    Richard Halls New Member

    Messages:
    13
    The attached file has the macro and the data that is supposed to copy from one sheet into the other.

    Attached Files:

  4. Nebu

    Nebu Excel Ninja

    Messages:
    1,994
    Hi:

    Your attached sheet contains a recorded macro and is not coded properly, if you want a solution please explain what you want to achieve using the macro and attach the right work book with some dummy values.

    Note: In your macro you have mentioned sheet name 'Mac Rslt' which is not present in the uploaded file.

    Thanks
  5. Richard Halls

    Richard Halls New Member

    Messages:
    13
    I guess I sent the wrong file. The attached is the right one I hope.

    Attached Files:

  6. Nebu

    Nebu Excel Ninja

    Messages:
    1,994
    Hi:

    No the attached is not the right one, you have attached the same file. Also please explain what you want to do with the file. In your code you are trying to copy a formula as well. I cannot see any formula in your file. Where are the range mentioned in this part code in the attached spreadsheet.

    Code (vb):

    Range("A5").Select
        ActiveCell.FormulaR1C1 = _
            "    Worksheets(""Sheet1"").Range(""b19:d10"").Copy Worksheets(""Mac Rslt"").Range(""b3:d3"")"

     
    Thanks
    Last edited by a moderator: Jan 25, 2017
    jamesexcel1970 likes this.
  7. Richard Halls

    Richard Halls New Member

    Messages:
    13
    Copy to Sheet1 from Sheet2: a2:c2 to Sheet1 e4:g4 & h4 sum

    Copy to Sheet1 from Sheet2: d2:f2 to Sheet1 e5:g5 & h5 sum

    In Sheet1 in e6, f6, g6 & h6 sum

    Attached Files:

  8. Richard Halls

    Richard Halls New Member

    Messages:
    13
    The last file I sent was corrupted I think. There are new instructions in Sheet1

    Attached Files:

  9. Monty

    Monty Well-Known Member

    Messages:
    700
    Hello Richard.

    Please find attached file for your question..
    Please click on the Run button in Sheet2.

    Hope this helps...Please let me know further development of the file...Happy to help you..Monty.

    Attached Files:

    jamesexcel1970 likes this.
  10. Richard Halls

    Richard Halls New Member

    Messages:
    13
    Nothing happens. Maybe the code has to be in a module.
  11. Monty

    Monty Well-Known Member

    Messages:
    700
    Hello Richard..

    code is in the module and linked to button to click.
    jamesexcel1970 likes this.
  12. Richard Halls

    Richard Halls New Member

    Messages:
    13
    I don't see a red button.
  13. Monty

    Monty Well-Known Member

    Messages:
    700
    Hello Richard.

    Screenshort for your reference.

    Open the file and look for sheet 2.

    Please Let me know..if you still don't find

    upload_2017-1-26_1-44-8.png

    Attached Files:

    jamesexcel1970 likes this.
  14. Richard Halls

    Richard Halls New Member

    Messages:
    13
    Attached is my screen shot. Maybe the file you have has some code that is different than mine. When you hit run does it copy the data?

    Attached Files:

  15. Richard Halls

    Richard Halls New Member

    Messages:
    13
    Mayge the problem is that I'm using Office 10
  16. Monty

    Monty Well-Known Member

    Messages:
    700
    Hello Richard.

    That should not be a problem...Iam using office 2013 should work in 2010 as well..Let me know what you see in Sheet 2...Both are using same file format that is .XLSM which is macro enabled file only...
    jamesexcel1970 likes this.
  17. Richard Halls

    Richard Halls New Member

    Messages:
    13
    Sheet2

    Attached Files:

  18. Monty

    Monty Well-Known Member

    Messages:
    700
    Richard...Am not really sure...why you are not able to see button..


    Just say Alt +F8 to open macro window then click run...Check if macro is working then we can think about adding button to it.

    Uploaded one more file...Please check at the same time.

    upload_2017-1-26_4-5-16.png

    Attached Files:

    Last edited: Jan 25, 2017
    jamesexcel1970 likes this.
  19. Richard Halls

    Richard Halls New Member

    Messages:
    13
    What happend when you Run. Do you get any results?
  20. Richard Halls

    Richard Halls New Member

    Messages:
    13
    I've run it many times.
  21. Monty

    Monty Well-Known Member

    Messages:
    700
    Thank you for being on forum!!!!!!
    jamesexcel1970 and Derek McGill like this.
  22. Richard Halls

    Richard Halls New Member

    Messages:
    13
    So you don't get any results and don't have a solution.
  23. Derek McGill

    Derek McGill Member

    Messages:
    122
    The file and code from "Monty" works for me !
  24. Monty

    Monty Well-Known Member

    Messages:
    700
    Hello Richard....

    Your are welcome. ..Let me know any more questions on this..

    Month.
    jamesexcel1970 likes this.

Share This Page