how do you automatically generate a letter on certain dates

S

Solly

Greg Maxey said:
Solly,

<i have 8 columns and the date is in the 8th col. with the date format like
JUL/28/1968 should i use myArray(i, 8) instead of myArray(i, 0).

That would depend on whether you loaded all of the information from the
table into the array.

Huh? what is myArray(i, 0),myArray(i, 2),myArray(i, 3) in your code?
I didn't test this but to get a match using JUL/28/1968 with the system
date, then you would probably have to use something like:

If Fromat(myArray(i, 0), "M/dd") Like Format(Date, "M/dd") Then

perhaps you meant "MMM/dd/yyyy"

How do i subtract days from the date of today?
A table is an object (I think) so my convention is oTbl.

is there an oDate object and how does it get the hebrew lunar date if i want
it?
 
G

Greg Maxey

Gordon,

I think it would get voted down ;-)

Solly,

I have done all that I can do for free.
 
G

Gordon Bentley-Mix

You're probably right. Besides, there's already a St. Gregory - Pope from 590
to 604.
 
G

Greg Maxey

I changed my mind and decided to give you some more fish.
Huh? what is myArray(i, 0),myArray(i, 2),myArray(i, 3) in your code?

As far as I can see, I didn't use myArray(i, 3) in my code.

myArray is a two dimensional array of data. Think of it like a place to put
the values in a multiplicaiton table:

Sub BuildSimpleArray()
Dim myArray(2, 2) As String
myArray(0, 0) = "1"
myArray(0, 1) = "2"
myArray(0, 2) = "3"
myArray(1, 0) = "4"
myArray(1, 1) = "5"
myArray(1, 2) = "6"
myArray(2, 0) = "7"
myArray(2, 1) = "8"
myArray(2, 2) = "9"
MsgBox "3 x 3 = " & myArray(2, 2)
End Sub

Arrays use Zero base as an index to the first data storage location is (0,
0)

If I use "i" as a varialbe and make "i" = 1 then

Msgbox myArray(i, 2) would return what? If you answered 6 then perhaps
you are learning to catch your own fish.

perhaps you meant "MMM/dd/yyyy"

No I meant exactly what I said.

You could try until the cows come home, but you will never make some date
picked from a table e.g. 7/21/1968 "look" like 7/21/2008. Unless the date
picked was 7/21/2008

So if your table column has dates in the format JUL/21/1968 you are going to
have to change it's format to look at only the day and month then compare
that to the current day and month. If they look the same then create the
letter.

As for the sayings or quotes then you would need to do some more processing.
This is just a swag, but something like:

Sub ScratchMacroII()
Dim myDate As Date
myDate = "July/18/1968"
If DateDiff("yyyy", myDate, Date) = 40 Then
MsgBox "Lordy, Lordy, look who is forty"
End If
End Sub
How do i subtract days from the date of today?

This shows one way:

Sub ScratchMacroIII()
Dim myDate As Date
myDate = DateAdd("d", -3, Date)
MsgBox myDate
End Sub
is there an oDate object and how does it get the hebrew lunar date if i
want it?

I give up ;-)
 
G

Gordon Bentley-Mix

Expect to hear from the Congregation for the Causes of the Saints any day
now...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top