+ Reply to Thread
Results 1 to 9 of 9

Macro - debug error

  1. #1
    Registered User
    Join Date
    05-18-2009
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    34

    Macro - debug error

    Any help would be appreciated

    Please Login or Register  to view this content.
    Last edited by emptycucumber; 05-18-2009 at 10:05 PM.

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Macro - debug error

    Hi emptycucumber,

    Welcome to the forum and thanks for fixing up your post.

    Post back re how the following goes:

    Please Login or Register  to view this content.
    HTH

    Robert
    Last edited by Trebor76; 05-18-2009 at 10:39 PM.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    05-18-2009
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Macro - debug error

    OMG!!! AMAZING

    Thank you so much. You cleaned up the code so nicely too.

    Works perfect!

    QUESTION: How would I go about writing a code to delete the contents of a cell?
    Last edited by emptycucumber; 05-18-2009 at 11:54 PM.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,959

    Re: Macro - debug error

    To fix the original code:
    Please Login or Register  to view this content.
    where the numbers in [] are the offsets from the selected cell.
    & RC[-8] = R[]C[-8]; references a cell in the same row as the selected cell.
    Last edited by protonLeah; 05-19-2009 at 12:24 AM.
    Ben Van Johnson

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Macro - debug error

    Hi emptycucumber,

    Glad it worked

    The following will delete all contents within cell A5...

    Please Login or Register  to view this content.
    ...while the following will delete all contents from the range A5:B10:

    Please Login or Register  to view this content.
    HTH

    Robert

  6. #6
    Registered User
    Join Date
    05-18-2009
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Macro - debug error

    Works!

    Hmm, actually I would prefer to make the cell value "0". How would I do that?

    Range("D4").Value something?
    LOL! I was about to ask you that question, but I figured it out on my own.

    I'm a beginner, so excuse me Thanks for the help!
    Last edited by emptycucumber; 05-19-2009 at 01:02 AM.

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Macro - debug error

    You're welcome

  8. #8
    Registered User
    Join Date
    05-18-2009
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Macro - debug error

    How do I include a logical value?

    Sub Shipping_Company()
    Range("shipping").Value = Evaluate("=shipping+1")
    Range("undeveloped").Value = Evaluate("=undeveloped-4")
    End Sub
    IF undeveloped=4 Range("undeveloped").Value = Evaluate("=undeveloped-4")
    IF undeveloped=3 Range("undeveloped").Value = Evaluate("=undeveloped-3")

    etc etc, of course I'd clean up the code. I just need to know how to structure it.


  9. #9
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Macro - debug error

    Hi there,

    You should really start a new thread for each separate query.

    That said, I'm not sure how many arguments you're referring to when you say "etc etc" but I think the following may be what you're after:

    Please Login or Register  to view this content.
    HTH

    Robert

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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