+ Reply to Thread
Results 1 to 26 of 26

Error with a formula in my macro that is not allowing my macro to run

  1. #1
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Error with a formula in my macro that is not allowing my macro to run

    Hi

    I tried to amend the following macro however before I can proceed any further its giving me an error

    The first line of formula works ok

    The second and third lines of formula is where the problem lies

    will appreciate all help in order to fix my macro wherever possible

    Thank you in anticipatioe

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by khanaran; 01-28-2020 at 03:55 AM. Reason: fix spelling

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Require some help with my macro am doing something incorrect

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

  3. #3
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: My macro has error in the coding that I require help with

    Hi Sir

    I tried to correct title will this be ok

    Raj

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: My macro has error in the coding that I require help with

    Not really. You talk about an error. Where does it appear in your code ? Which error is it?
    That would be a good start for a decent title

  5. #5
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    Hi Sir

    will this change on the title be better

    Raj

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Error with a formula in my macro that is not allowing my macro to run

    Which error do you get???
    In your description you talk about 1st line of code, second, etc... Those are only declarations.

  7. #7
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    Hi Sir

    This formula in the code is giving me the error

    Please Login or Register  to view this content.
    regards

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

    Re: Error with a formula in my macro that is not allowing my macro to run

    You need to double-up on the quotes inside the formula, in the same way you have with the formula for column K

  9. #9
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    Hi Sir

    can you please show me where to double up on the quotes please

    regards

    raj

  10. #10
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Error with a formula in my macro that is not allowing my macro to run

    Any quote (") that is INSIDE the formula must be doubled (""). Besides that you have a bracket problem too. Best is to build the formula in a cell, then make all quote signs double.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  11. #11
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    Hi

    When I do it manually it works but when am trying it in the macro its giving me an error

    am not good at macros got help mostly with this

  12. #12
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Error with a formula in my macro that is not allowing my macro to run

    Ok but when i try your formula in a cell, it gives an error because of the brackets, so can you post exactly manual formula from cell? Then I'll add the quotes.

  13. #13
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    H

    Thanx

    Please Login or Register  to view this content.
    this is the formula that I use in the cell


    Thank you so much

    Raj

  14. #14
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Error with a formula in my macro that is not allowing my macro to run

    Please Login or Register  to view this content.
    Becomes:
    Please Login or Register  to view this content.
    And:
    Please Login or Register  to view this content.
    Becomes:
    Please Login or Register  to view this content.
    As you can see all I did was take the quotes inside the formula, and put 2 quotes in all places that had 1

  15. #15
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    Hi Thanx for fixing the formula

    however when I add the range with the formula, it creates the column "O" but
    the values are not written in

    Please Login or Register  to view this content.
    regards
    raj

  16. #16
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Error with a formula in my macro that is not allowing my macro to run

    Those O's in the range actually look like a number 0 not letter O?

    Also, before the .Value = .Value line.... is the result of the formula ok? It may be the formula itself is not working as you wish
    Last edited by Arkadi; 01-28-2020 at 12:52 PM.

  17. #17
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    Hi Thanx

    I am attaching a manual sheet that has the formula that works but when I try to put into macro

    it creates the column but does not write in the values

    regards
    Attached Files Attached Files

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

    Re: Error with a formula in my macro that is not allowing my macro to run

    What exactly are you expecting to see in column O?

  19. #19
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    In column N we have the following values (10-50-2) and the formula in col O will return the avg of RH +MD of column N i.e. (10+50)/2 = 30

    manually it works but when I try macro it creates col O but no values is entered therein

    regards

    raj

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

    Re: Error with a formula in my macro that is not allowing my macro to run

    because you are inserting columns your columns are not in the right place

  21. #21
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    Hi

    Thanx for pointing out my mistake

    can you please guide me as to how I can get the macro to what I would like it to do

    Raj

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

    Re: Error with a formula in my macro that is not allowing my macro to run

    Not without knowing what you are trying to do.

  23. #23
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    Hi

    Ok thanx

    I will add in here the macro and also a file to show what I would like to achieve

    the worksheet racescrape is where I paste in data after it had been scraped and run the macro

    racedata is the file that's is created the first formula is ok but the second and third , columns created but the formula is not written

    regards

    raj
    Attached Files Attached Files

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

    Re: Error with a formula in my macro that is not allowing my macro to run

    Try
    Please Login or Register  to view this content.

  25. #25
    Forum Contributor
    Join Date
    09-25-2011
    Location
    Lenasia, Johannesburg,South Africa
    MS-Off Ver
    Excel 2019
    Posts
    269

    Re: Error with a formula in my macro that is not allowing my macro to run

    Hi


    Many thanx for the fix, its working brilliantly

    only small snag its showing last entry of one race to the beginning of the second race a #value error

    kind regards
    Raj

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

    Re: Error with a formula in my macro that is not allowing my macro to run

    Then change this
    Please Login or Register  to view this content.
    to whatever it needs to be.

+ 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. Require Help to Modify VBA Macro
    By patrickwest in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2016, 11:39 PM
  2. [SOLVED] Forumula Results Incorrect when data missing. Wanting to hide the incorrect formula.
    By firemedic6265 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-05-2014, 05:01 PM
  3. Macro to require a unique password
    By Jhansen5452 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-30-2013, 12:37 PM
  4. Require faster Macro Code
    By wiehan in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 07-17-2012, 02:04 PM
  5. Require faster Macro Code
    By wiehan in forum Excel General
    Replies: 1
    Last Post: 07-17-2012, 01:52 PM
  6. [SOLVED] Require Help - Require Formula for Multiple values in both columns
    By krodge in forum Excel General
    Replies: 6
    Last Post: 01-13-2012, 03:42 AM
  7. Require condition to run macro
    By MnMShow in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2010, 11:17 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