tag:blogger.com,1999:blog-1086764876629036045.post5271411647463813987..comments2023-10-06T06:29:02.689-04:00Comments on A Bright Cape: CodingSkyhttp://www.blogger.com/profile/10723733406348223879noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-1086764876629036045.post-58102710290957950532010-11-09T15:56:37.808-05:002010-11-09T15:56:37.808-05:00Coding is awesome. We were talking about explorat...Coding is awesome. We were talking about exploration in video games the other night. Coding is the best exploration game there is.Sthennohttps://www.blogger.com/profile/05429676469805661834noreply@blogger.comtag:blogger.com,1999:blog-1086764876629036045.post-32014867887185338472010-11-09T14:40:55.397-05:002010-11-09T14:40:55.397-05:00It is entirely possible it got added into VBA itse...It is entirely possible it got added into VBA itself in a future version but the version I'm running here at work has no roundup function in VBA, and the only reference in the help file is to worksheetfunction.roundup which uses the Excel one. (Application.worksheetfunction.roundup is the fully qualified way to access it, but the application.roundup shortcut seems to work for me.)Ziggynyhttps://www.blogger.com/profile/07518980519046202646noreply@blogger.comtag:blogger.com,1999:blog-1086764876629036045.post-78323301495295321732010-11-09T14:12:46.229-05:002010-11-09T14:12:46.229-05:00The internet and the help section for VBA fully be...The internet and the help section for VBA fully believe that there is a VBA function with that name. They sure don't seem to be right, but they tell me all about it and how to use it and are very clear that it is part of VBA code and not excel itself. Why this is I do not know.<br /><br />Option Explicit is exactly what I need to stop myself making one class of terrible mistakes. Thanks! Now I can spend more time on other types of mistakes. :)Skyhttps://www.blogger.com/profile/10723733406348223879noreply@blogger.comtag:blogger.com,1999:blog-1086764876629036045.post-59727810113811384512010-11-09T13:32:56.272-05:002010-11-09T13:32:56.272-05:00As a tip, put Option Explicit at the top of your m...As a tip, put Option Explicit at the top of your module. This forces every variable to be declared before use and will throw an error when you try to run a subroutine that has an undeclared variable instead of just trying to wing it.<br /><br />For roundup, there is no such VBA function, but there is an Excel function with that name. You can access the Excel function with application.roundup(number, precision). Alternatively, you can use the actual VBA function round, which you can trick to do a base roundup instead of round by using round(number-.5, 0)+1.Ziggynyhttps://www.blogger.com/profile/07518980519046202646noreply@blogger.com