+ Reply to Thread
Results 1 to 3 of 3

Performing Long formula in VBA (2010)

  1. #1
    Registered User
    Join Date
    08-24-2011
    Location
    orlando
    MS-Off Ver
    Excel 2003
    Posts
    2

    Post Performing Long formula in VBA (2010)

    Hi, I'm trying to create a macro in VBA to output to Cell(BD24). I see code going something like this.

    If Cell(L40) = "1d6" then x = 1 , y = 6
    If Cell(L40) = "1d4" then x = 1 , y = 4
    If Cell(L40) = "1d20" then x = 1 , y = 20
    (and so on for 1d2, 1d8, 1d10, 1d12)

    i = RANDBETWEEN(x,y)

    If i = y , then Change cell color to green
    If i = x , then Change cell color to red
    i = i + Cell(G39)
    Output to Cell(BD24)

    (I will be posting another thread trying to do a similar function if a certain cell colour is red or green... unless it's answered here)
    Thanks ahead for all the help :D

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Performing Long formula in VBA (2010)

    Welcome to the forum!

    I had one question in the comment for "i" at the end. Was that the value for BD24?

    Copy this to a Module:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-24-2011
    Location
    orlando
    MS-Off Ver
    Excel 2003
    Posts
    2

    Smile Re: Performing Long formula in VBA (2010)

    Hey, yeah that was very helpful. I think i'm gonna have to adjust it to a few other things but you answered a lot of questions. The last line about " i " was the modifier for the roll. I through that in w/o describing it, sorry about that. Thanks again for all the help, I should be posting more things here in the near future

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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