+ Reply to Thread
Results 1 to 7 of 7

Errors in VBA code

  1. #1
    Registered User
    Join Date
    10-20-2014
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 365
    Posts
    40

    Errors in VBA code

    I am having a problem sorting out cell references and calculations on the "Invoice Worksheet" on the attached file.

    They relate to a macro called "Inv"

    1. Cell C9 should be a vacant cell
    2. The result in cell E10 should be in cell F13
    3. I cannot get the "Amount Column" and "Totals" to calculate on the "Invoice worksheet"

    Obviously vba is not my cup of tea as I have spent many hours trying to resolve this!

    Any help would be greatly appreciated.

    Regards
    Michaelinvoice_control_new_work_copy.xlsm

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Errors in VBA code

    G'day mate and welcome.

    I had a play. Try this. Is this what you wanted?

    invoice_control_new_work_copy(1).xlsm
    Happy with my advice? Click on the * reputation button below

  3. #3
    Registered User
    Join Date
    10-20-2014
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 365
    Posts
    40

    Re: Errors in VBA code

    Hi Crooza,

    Some gains and some losses alas!

    When clicking on "view invoice" button on the "Invoice worksheet" cell C10 is populated from "Invoice Data" column "J" This should not happen,

    On the "Invoice worksheet" when clicking on "View Invoice" button additional data appears in the "amount column" that is incorrect ie not shown against the "Invoice #" data shown on the "Invoice Data" worksheet.

    Thanks for trying - I think you can understand my dilemma.

    '

  4. #4
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Errors in VBA code

    I'll try to review tonight. Was the c10 issue happening before I looked at it? You don't mention it in your original post and I can't imagine the changes I made affected that.

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Errors in VBA code

    invoice_control_new_work_copy(1).xlsm

    Try this one. It seems to fix the issues you raised in your last post

  6. #6
    Registered User
    Join Date
    10-20-2014
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 365
    Posts
    40

    Re: Errors in VBA code

    Yahoo this seems to have fixed my problem!!!!
    Now I will have to look closely to see how you fixed it so I can learn more
    Thanks Crooza - your a legend

  7. #7
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Errors in VBA code

    Great. Glad it worked. I commented out a few lines of code (rather than deleting it for the c9 and c10 issue) and the rest was just extending the range for the clear contents from column G to column H and picking up an extra column in the paste areas

+ 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. Need help cleanup vb code.. Some errors!
    By vexious in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-09-2012, 01:54 PM
  2. Autofilter VBA Code Errors
    By geng in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2010, 07:22 PM
  3. code to search for errors
    By iliam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2008, 07:19 AM
  4. Same code - errors on different machine?
    By JWM6 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2006, 08:39 PM
  5. VBA Code Errors
    By PaulW in forum Excel General
    Replies: 3
    Last Post: 04-04-2006, 08:25 AM

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