Bob? Code to Post?

Thanks Bob!

Could you put the code in a reply to this message!

Also what does

Dim cellvalue

do?

Thanks
Nick

0
anonymous (74722)
1/20/2004 11:22:58 PM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
337 Views

Similar Articles

[PageSpeed] 24

This is my entire module reposted. Should work, as far as I can tell.
It's reporting the correct values on lose. (What was happening, was,
when it would put down the "Lose", the value of B2 would recalculate,
and no longer be 7.)

And FYI, Dim cellvalue defines 'cellvalue' as a variable which I can
pass data to. I use it to define what cell is currently being used.

START OF MODULE (Insert New Module, Paste from the top)

Dim cellvalue

Sub Craps()
'Excel Craps V1.1
Setup:
Application.ScreenUpdating = True
[B5] = [B2]

Rollem:
If (([B5] = 2) Or ([B5] = 3) Or ([B5] = 12)) Then GoTo CrapOut
If (([B5] = 7) Or ([B5] = 11)) Then GoTo FirstLucky
cellvalue = 0
GoTo NotWinner
End

NotWinner:
Application.ScreenUpdating = True
Application.Calculate
Repeater:
cellvalue = cellvalue + 1
If ([B2] = "7") Then GoTo SevenLose
Worksheets("Sheet1").Cells(cellvalue + 5, 2).Value = [Sheet1!B2]
If ([B2] = [B5]) Then GoTo Winner
GoTo LoopAround
End

LoopAround:
GoTo Repeater
End

Winner:
Worksheets("Sheet1").Cells(cellvalue + 5, 2).Value = [B2]
Worksheets("Sheet1").Cells(cellvalue + 5, 3).Value = "Win"
Beep
Beep
Beep
Application.ScreenUpdating = True
End

SevenLose:
Worksheets("Sheet1").Cells(cellvalue + 5, 2).Value = "7"
Worksheets("Sheet1").Cells(cellvalue + 5, 3).Value = "Lose"
Application.ScreenUpdating = True
End

FirstLucky:
[C5] = "Win"
Beep
Beep
Beep
End

CrapOut:
[C5] = "Lose"

End Sub

END OF MODULE

Might be back on the forums / NG later in the day. Got presentations to
prepare before lunch.

Hope it helps.

-Bob


---
Message posted from http://www.ExcelForum.com/

0
1/21/2004 12:02:21 AM
Hi Bob

Had to rename some of the coding because it was in there 
twice, eg. >SevenLose: to >SevenLoseAgain:

Otherwise all OK!

Still don't really get Dim cellvalue

Thanks tho
Nick


>-----Original Message-----
>This is my entire module reposted. Should work, as far as 
I can tell.
>It's reporting the correct values on lose. (What was 
happening, was,
>when it would put down the "Lose", the value of B2 would 
recalculate,
>and no longer be 7.)
>
>And FYI, Dim cellvalue defines 'cellvalue' as a variable 
which I can
>pass data to. I use it to define what cell is currently 
being used.
>
>START OF MODULE (Insert New Module, Paste from the top)
>
>Dim cellvalue
>
>Sub Craps()
>'Excel Craps V1.1
>Setup:
>Application.ScreenUpdating = True
>[B5] = [B2]
>
>Rollem:
>If (([B5] = 2) Or ([B5] = 3) Or ([B5] = 12)) Then GoTo 
CrapOut
>If (([B5] = 7) Or ([B5] = 11)) Then GoTo FirstLucky
>cellvalue = 0
>GoTo NotWinner
>End
>
>NotWinner:
>Application.ScreenUpdating = True
>Application.Calculate
>Repeater:
>cellvalue = cellvalue + 1
>If ([B2] = "7") Then GoTo SevenLose
>Worksheets("Sheet1").Cells(cellvalue + 5, 2).Value = 
[Sheet1!B2]
>If ([B2] = [B5]) Then GoTo Winner
>GoTo LoopAround
>End
>
>LoopAround:
>GoTo Repeater
>End
>
>Winner:
>Worksheets("Sheet1").Cells(cellvalue + 5, 2).Value = [B2]
>Worksheets("Sheet1").Cells(cellvalue + 5, 3).Value = "Win"
>Beep
>Beep
>Beep
>Application.ScreenUpdating = True
>End
>
>SevenLose:
>Worksheets("Sheet1").Cells(cellvalue + 5, 2).Value = "7"
>Worksheets("Sheet1").Cells(cellvalue + 5, 3).Value 
= "Lose"
>Application.ScreenUpdating = True
>End
>
>FirstLucky:
>[C5] = "Win"
>Beep
>Beep
>Beep
>End
>
>CrapOut:
>[C5] = "Lose"
>
>End Sub
>
>END OF MODULE
>
>Might be back on the forums / NG later in the day. Got 
presentations to
>prepare before lunch.
>
>Hope it helps.
>
>-Bob
>
>
>---
>Message posted from http://www.ExcelForum.com/
>
>.
>
0
anonymous (74722)
1/21/2004 1:15:13 AM
Reply:

Similar Artilces:

Multiple Bar Codes Per Item
I'm looking to use Microsoft RMS for a medium sized game store with one terminal. One critical feature is the ability to have multiple bar codes assigned to the same item. Can RMS do this? Gary Gary, If you are talking about multiple part numbers, yes, use the alias function. Remember what a barcode is. Its a graphical representation of a partnumber that is machine readable. It doesn't describe the item, it is only a number to reference that item. Just like your phone number, it means nothing, but everytime someone dials that number, it gets to you. -- * "gareman" ...

Please help..with a formula. I don't know code.
I have a long list of numbers - values in a file X, and I want to fin and replace those values in a even larger list in a file Z an highlight those values in Z -- Message posted from http://www.ExcelForum.com Hi not really sure what you're trying to achieve. What do you want to replace, etc. You may give an example (plain text - no attachment please) >-----Original Message----- >I have a long list of numbers - values in a file X, and I want to find >and replace those values in a even larger list in a file Z and >highlight those values in Z. > > >--- >Message...

Appointment times won't post correctly
On the calendar, appointments, meetings, etc. made or received show up on the date and time received or sent; regardless of the actual date or time of the appointment. Is there a setting that will correct this? I've exhausted myself trying to find a fix. Outlook 2003 There is a seperate calendar time zone setting that has to be set in addition to your system clock. Pain in the ass. Go to Options and then select Calendar. You should see the Time Zone button there. Set it accordingly, but be aware that everything in your calendar up to that point will change. "Keith Wilso...

RSS feeds not picking up correct posting date
I have several feeds that I am reading in outlook that do not get the correct post date and therefore sort incorrectly and won't work with my search folders. IE7 correctly reads the post dates so this appears to be an outlook 2007 problem e.g. in these feeds http://amapplease.blogspot.com/feeds/posts/default http://shmup.blogspot.com/feeds/posts/default http://gameylittlehacker.blogspot.com/feeds/posts/default http://bankdeals.blogspot.com/feeds/posts/default all dates show in outlook as 1/1/2007 12:00am but are correct in IE7 Hmm now I get all the examples I notice they are ALL bl...

vba code to enable macros
Hi, Can we write a vba code to enable macros. In most of the sites it says we cant do that . The only thing we can do is change the macro setting or work around is hide the sheet which has macros. But none of them will work in my case. Can we change an excel security setting to from macro on open so that macros are enabled. No. If we can do that with code, then so could a hacker with bad intentions. Mike F "varsha12" <varsha12@discussions.microsoft.com> wrote in message news:DBEB1614-C956-491B-B351-02DD9F711891@microsoft.com... > Hi, > Can we w...

Error Code 80070424 12-21-09
I keep getting this Windows update error every time I boot my PC. In the window, it says Windows can't check for updates. Does anyone have any ideas? Recently I installed BitTorrent so could that be my problem? "Norm" <Norm@discussions.microsoft.com> wrote in message news:D2E5CF0C-D31B-4034-B4A8-A8204763A623@microsoft.com... > I keep getting this Windows update error every time I boot my PC. In the > window, it says Windows can't check for updates. Does anyone have any > ideas? > > Recently I installed BitTorrent so could that be my proble...

VBA and VB.NET give different results for same RegEx code
Excel 2007 & 2003 If you are thinking "Not this group" I can understand. That said, I am not sure where else to start? Assume myCell.formula = "=2620137" also FormulaText = "=2620137" Assume a "For Each objMatch In objcolMatches" which produces an "objMatch" in VBA of 2620137 But in VB.NET, the FormulaTest is parsed like: 2 6 2 0 1 3 7 GOAL: How to get VB.NET to match the VBA result of 2620137? Any thoughts appreciated EagleOne ********************** Code *****************************...

Trouble debuggin mixed managed / unmanaged code
Hi there I´m working in a project that mixes managed and unmanaged code. While debuggin my unmanaged code that makes a call to a DLL that uses managed code I get a dialog box with this message: "There is no source code for the current location", along with a checkbox "Show disassembly automatically" and three buttons, OK, SHow Disassembly and help. Both projects (unmanaged c++ app and the managed dll) are seted to use managed extensions and the debug mode is seted to "mixed". Any hint ou there to solve this problem? Thanks in advance. check that the dir...

Contact looses Post Office Box field when synchronized to Outlook
When I sync contacts from CRM 4.0 to Outlook, the Post Office Box field from the contact gets empty. Anyone has the same issue? ...

setting a column value in code for an updatable ViewGrid
Is there a way to set the value for a column in code when a ViewGrid row is edited? I have a row-last-updated date that is a required audit field in all our systems (required by data management). I don't really want the user updating this field as it should always be system controlled. If I create an editable ViewGrid tied to either an SqlDataSource or an ObjectDataSource, the field seems to only be updatable by the user. I can set it the first time by setting the DefaultValue in code but that has no effect after there is an initial value in the column. Do I need to co...

Reducing Spam Associated with Posting to Newsgroups
Due to a recent increase in spam sent to posters in newsgroups, Microsoft advises that newsgroup participants should consider avoiding posting to newsgroups using their real email address. Microsoft is also committed to continuing to address the issue of spam from a technological perspective. To help avoid receiving unwanted messages (spam) in your regular e-mail account, you may not want to include your regular e-mail address when you post a question or reply to a post in a discussion group. Instead you may want to do one of the following: * Use a modified e-mail address: Use a different v...

Manage Offline Inventory & Reason Codes
Is there a way to FORCE an employee to use a reason code on the manager side when adding an item into Manage Offline Inventory? Also is there a way to delete an item that was added? -- Thank You Vince :) ...

VBA code (rules) won't work after reboot
First off I am not very knowlegeable about Outook or VBA coding so I apologize in advance for missing the obvious. I have created some rules in outlook (actually exported/imported from a functioning account). The rules basically: -look for an email with an attachment and with a specific word in the subject line -move the email to a different folder -copy the attachment and place it in a shared system folder (done with VBA code) The problem I have is the rules will only work until Outlook is closed down or the server is rebooted. After that the rules partially work (the VBA...

Filling Posting Journals and Invoices
Hi, can anyone show me the best way to file away all document such as posting Journals for RM,PM,...... Thanks Not sure if this is the "best way", but what I do is file them by module AP, RM, SOP and then by audit trail code in numerical order. The GL for our company references the batch ID, which is the same as the audit trail code for the module. This filing method has been helpful, when needing to research inventory transactions and adjustments. "Mike" <Mike@discussions.microsoft.com> wrote in message news:DBC9C819-8E4B-42B9-9B0B-848761670EA3@microsoft...

Errors found Code 80070490
This appears to be one of those problems that no one seems to have a working solution. Reinstalling an operating system is not a solution it’s a reason to change operating systems. This type of problem was not supposed to happen with Vista. Let’s see some big guns on this one! Update Error: Some Updates not installed: 2 Failed updates (KB967723, KB972145) Errors found Code 80070490 (Unknown Error) Problem signature: Problem Event Name: WindowsUpdateFailure ClientVersion: 7.4.7600.226 Win32HResult: 80070490 UpdateId: AE2C61ED-AC12-4369-BED6-4375CD79CA...

Error in Code
Following is some VBS code I have in my Custom Form developed in Outlook 2003. Line 61 is giving me an error stating: Object doesn't support this property or method: 'Item.GetInspector.ModifiedFormPages' Line No: 61 If you look Line 51 is the same method and it works fine. The funny thing is when I run the code, I get the error, I continue on to the Form, and the code after it works. The code that follows line 61 is dependent on line 61 as evident by if I ' comment it out, I get a separate error asking for objPage2. The code also works if I change the value of one of...

matching codes between 2 item codes
Hi Is there someone who can tell me how I can match up (or link) codes from one spreadsheet to another? Cheers -- JChan ------------------------------------------------------------------------ JChan's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=23273 View this thread: http://www.excelforum.com/showthread.php?threadid=476450 Hi J, Perhaps the VLookup function is what you are looking for. See Excel help for details. --- Regards, Norman "JChan" <JChan.1wxdqa_1129349100.7983@excelforum-nospam.com> wrote in message news:JChan.1wxdqa_11...

Tabular Form and VBA coding
Hi, I created a form with Master and Child relationship. My child (subform) is a tabular form that displays data based on the selection for student number from master form. So as soon as user selects student number from combo box all the following fileds displays in a subform: Student name, Role Assigned, Status, Severity_code, Relation, date open and class id, A1, A2. Everything works fine. But now I would like to add another field (which is not in the database) Days aging to this subform and would like to calculate the dates student is behind in his/her payment. I have a custom made fu...

Help with trying to post a file to a secure website
I have been struggling with this for a couple of weeks. I have a digital certificate installed in my certificate collection store on my local computer. The site I am trying to post to also has our certificate installed is said it is ready to recieve transactions. I have created a file (xml) and I want to post to the given web address. An example of the web address is https://some.company.com/location this is what I have tried: aStreamReader = New StreamReader("C:\MyTest2.txt") postData = aStreamReader.ReadToEnd() Dim data As Byte() = encoding.GetBytes(postData) Dim myRe...

To Bob(regarding drop downs)- Pls reply
Thanks sooooo much for the prompt reply Bob. I am not sure how I'd modify this to apply it to my spread sheet.I'd really appreciate it if you could reply to this one as well. Say in Column B i have a couple of L and a couple of Ms (first 4 rows). So when I add it up , it should give me (1+1+2+2)=6. How will I change the equation you just gave me to apply it to this column and rows? Thanks in anticipation Here is one way for B2:B100, use =SUMPRODUCT(((B2:B100="L")*1)+(B2:B100="M")*2+(B2:B100="H")*3) -- HTH RP (remove nothere from the email ad...

Listserver postings to postmaster
Exchange Server 2003 with 50 WinXP Pro client issue I have a problem where all inbound traffic is being routed correctly to the appropriate mailboxes. However, if a user on the network has subscribed to a listserver, the inbound email comes through to me (postmaster)....despite the fact that the email is addressed correctly with the address of the user! TIA Maurice ...

MultiLine Code Builder, Need Help to Clean Code:
My end goal is to create multi-line code that I can paste into VBE. Currently I'm pasting code like this... If Worksheets("vessel").Cells(CurVesl,8).Value Then Else frmVesselLog.DTPICKER1.value = Worksheets("vessel").Cells(CurVesl,11).Value End IF For example Column D is:If Worksheets("vessel").Cells(CurVesl,8).Value Then Column E is : Else Column F is: frmVesselLog.DTPICKER1.value = Worksheets("vessel").Cells(CurVesl,11).Value Column G: End IF Column H is row1 If Worksheets("vessel").Cells(CurVesl,8).Value Then row2 E...

Cannot post to worksheet, possibly locked?
I have some automation code where I am posting some data from an Access DB to a formatted, unlocked Excel Spreadsheet. The Workbook (wb) has 3 worksheets (ws) named MEL, ERD, RCPT. The problem I am having is posting to the ERD ws. At first I thought it was because the ERD was ws(2), but then when I swapped with MEL with ERD and made the ERD the first ws, it still would not post to the ERD. In both cases, I had no problems posting to ws MEL whether it was ws(1) or ws(2). This wb is formatted with many merged cells. However the cells in the MEL worksheet are formatted no different that the ERD ...

Payments wont post with invoices using econnect
I am trying to send an invoice and a payment using econnect 8 and the <taPMtransactionInsert> xml doc. I can only get the INV to show in the payables section of GP. I need the payment to come with the invoice so that I can apply the payment to the invoice. I have listed what I am sending below please help!!! <!-- payables invoice creation --> <eConnect xmlns:dt="urn:schemas-microsoft-com:datatypes"> <PMTransactionType> <taPMTransactionInsert> <BACHNUMB>JOHNTEST</BACHNUMB> <VCHNUMWK>INVJOHN&l...

forum post test only
Has anyone been expiring posting problems into this group? Two of my postings were successful in submission by then appears to have "expired" when viewing. Lets see what happens when posting via Google Groups. Hector Santos wrote: > Has anyone been expiring posting problems into this group? Two of my > postings were successful in submission by then appears to have > "expired" when viewing. Lets see what happens when posting via Google > Groups. Reply via TBIRD.... -- HLS ...