[mso] Re: EXCEL integer division

  • From: "Greg Chapman" <greg@xxxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Mon, 5 Aug 2002 17:01:25 -0500

Okay, then that sample I wrote should be a valid example to adapt to
your Excel work. I tend to write those things into production as boolean
functions or merely 'clean function' form. In your case, I'd probably
set up on a conditional that looks like:

Sub BeamMeUpScotty()

'An Excel Range is a collection of cell(s)
Dim MyCell As Range
Dim MySheetName As String

'Excel has only 65535 Rows. That's an unsigned Int.
'Falls in range of Long
Dim MyRow As Long

'Excel only has 255 columns. That's a Byte
Dim MyColumn As Byte

MySheetName = "Sheet1"
MyColumn = 1
MyRow = 1

Set MyCell = Worksheets(MySheetName).Cells(MyRow, MyColumn)

'If the Cell is not empty AND the values are Numeric
If Not IsEmpty(MyCell.Value) And IsNumeric(MyCell.Value) Then
    PlotMyXY_OhYouWonderfulUser
    Debug.Print "Passed the Boolean test. Cell Value: " & MyCell.Value
Else
    GiveMeSomeFreakinData_LunkHead
    Debug.Print "Failed the Boolean test. Cell Value: " & MyCell.Value
End If

End Sub

Not that the meat of the routine is a Boolean expression in which the
Cell can't be empty and must contain a numeric value.

Greg Chapman
http://www.mousetrax.com 
"Counting in binary is as easy as 01, 10, 11!
With thinking this clear, is coding really a good idea?"


> -----Original Message-----
> From: mso-bounce@xxxxxxxxxxxxx 
> [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf Of Colli, Anthony G
> Sent: Monday, August 05, 2002 3:53 PM
> To: 'mso@xxxxxxxxxxxxx'
> Subject: [mso] Re: EXCEL integer division
> 
> 
> I am actually working in Access VBA trying to write a 
> function for an inventory management thing. In Excel I need 
> to create a map of the actual inventory. 'x','y' coordinates 
> in a box. I have the function in VBA done, I have been trying 
> to create the same thing on an Excel sheet. The idea was to 
> give the user a input box and the sheet would be created on 
> the fly depending on the variables entered. Instead of a 
> massive document just create what is needed. 
> 
> 

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx?Subject=unsubscribe

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: