Valiant Collection points question...
Moderators: Daniel Jackson, greg
- greg
- The admin around here must be getting old and soft.
- Posts: 22887
- Joined: Wed Feb 04, 2004 9:39 am
- Valiant fan since: Rai #0
- Favorite character: Depends on title
- Favorite title: Depends on writer
- Favorite writer: Depends on artist
- Favorite artist: Depends on character
- Location: Indoors
- Contact:
When I was testing it, I did the cut-and-paste in the VB Editor below the code that was already present.etos45 wrote:I don't know if I'm dumb or what, but this isn't seeming to work for me (oh... and really cool with the coding editor in excel). So, I pulled up the Alt-F11 Visual Basic editor. I clicked on Sheet 1. Then I pasted the code. Everything looked okay on that end, but when I went into excel and tried to call the function it gave me a name error. It's acting like the function isn't there, which makes me wonder if I forgot to do something in the VB editor to make it available?
(Mine has some stuff about PDFs that I guess are add-ins from Adobe.)
If your computer doesn't already have code there, you should try to put "Option Explicit" on the first line.
___________________________
Option Explicit
Public Function GetPoints(x As Variant, y As Variant) As Double
Dim i As Integer
GetPoints = 0
i = 1
Do While (i <= x)
GetPoints = GetPoints + (CDbl(y) / i)
i = i + 1
Loop
End Function
________________________________
Come to think of it, just email me your .xls file and I'll take a look.

Greg